| FlowLayout คืออะไร ? | เป็นรูปแบบของการจัดวาง layout โดยจะเรียง component จากซ้ายไปขวา |
|---|---|
| new FlowLayout() | ใช้สร้าง object flowlayout โดยมีระยะห่างระหว่าง component ทั้งแนวตั้งและแนวนอนคือ 5 pixel |
| new FlowLayout( flowlayout_constant ) | ใช้สร้าง object flowlayout โดยมีระยะห่างระหว่าง component ทั้งแนวตั้งและแนวนอนคือ 5 pixel และกำหนดวิธีการเรียง component ด้วย |
| new FlowLayout( flowlayout_constant, int_horizontal, int_vertical ) | ใช้สร้าง object flowlayout โดยมีการกำหนดระยะห่างระหว่าง component ทั้งแนวตั้งและแนวนอน และกำหนดวิธีการเรียง component ด้วยว่าจะให้เป็นลักษณะใด |
| setAlignment() | ใช้กำหนดวิธีการเรียง component ว่าจะให้เป็นลักษณะใด คือ เริ่มจากซ้าย, เริ่มจากขวา หรือเริ่มจากตรงกลาง |
| getAlignment() | ใช้คืนค่าวิธีการเรียง component ว่าเป็นลักษณะใด |
| setHgap() | ใช้กำหนดระยะห่างระหว่าง component ในแนวนอน |
| setVgap() | ใช้กำหนดระยะห่างระหว่าง component ในแนวตั้ง |
| getHgap() | ใช้คืนค่าระยะห่างระหว่าง component ในแนวนอน |
| getVgap() | ใช้คืนค่าระยะห่างระหว่าง component ในแนวนอน |
| LEFT | ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น เป็นรูปแบบการจัดเรียง component ที่เริ่มจากทางซ้ายมือ |
| RIGHT | ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น เป็นรูปแบบการจัดเรียง component ที่เริ่มจากทางขวามือ |
| CENTER | ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น เป็นรูปแบบการจัดเรียง component ที่เริ่มจากทางตรงกลาง |
subject:FlowLayout คืออะไร ?
content:FlowLayout เป็นรูปแบบของการจัดวาง layout โดยจะเรียง component จากซ้ายไปขวา และถ้าหากหมดบรรทัดก็จะขึ้นต้นบรรทัดใหม่ เหมือนการเขียนหนังสือ
method:new FlowLayout ();
return type:FlowLayout
content:ใช้สร้าง object flowlayout โดยมีระยะห่างระหว่าง component ทั้งแนวตั้งและแนวนอนคือ 5 pixel
example:FlowLayout flowlayout = new FlowLayout ();
method:new FlowLayout ( flowlayout_constant );
return type:FlowLayout
content:ใช้สร้าง object flowlayout โดยมีระยะห่างระหว่าง component ทั้งแนวตั้งและแนวนอนคือ 5 pixel และกำหนดวิธีการเรียง component ด้วยว่าจะให้เป็นลักษณะใด คือ เริ่มจากซ้าย, เริ่มจากขวา หรือเริ่มจากตรงกลาง
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT );
method:new FlowLayout ( flowlayout_constant, int_horizontal, int_vertical );
return type:FlowLayout
content:ใช้สร้าง object flowlayout โดยมีการกำหนดระยะห่างระหว่าง component ทั้งแนวตั้งและแนวนอน และกำหนดวิธีการเรียง component ด้วยว่าจะให้เป็นลักษณะใด คือ เริ่มจากซ้าย, เริ่มจากขวา หรือเริ่มจากตรงกลาง
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT, 10, 20 );
method:setAlignment ( flowlayout_constant );
return type:void
content:ใช้กำหนดวิธีการเรียง component ว่าจะให้เป็นลักษณะใด คือ เริ่มจากซ้าย, เริ่มจากขวา หรือเริ่มจากตรงกลาง
example:FlowLayout flowlayout = new FlowLayout (); flowlayout.setAlignment ( FlowLayout.RIGHT );
method:getAlignment ();
return type:int
content:ใช้คืนค่าวิธีการเรียง component ว่าเป็นลักษณะใด
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT ); if ( flowlayout.getAlignment () == FlowLayout.RIGHT ) { System.out.println ( "alignment is right." ); }
method:setHgap ( int_horizontal );
return type:void
content:ใช้กำหนดระยะห่างระหว่าง component ในแนวนอน
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT ); flowlayout.setHgap ( 10 );
method:setVgap ( int_vertical );
return type:void
content:ใช้กำหนดระยะห่างระหว่าง component ในแนวตั้ง
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT ); flowlayout.setVgap ( 20 );
method:getHgap ();
return type:int
content:ใช้คืนค่าระยะห่างระหว่าง component ในแนวนอน
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT ); int space_horizontal = flowlayout.getHgap ();
method:getVgap ();
return type:int
content:ใช้คืนค่าระยะห่างระหว่าง component ในแนวนอน
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT ); int space_vertical = flowlayout.getVgap ();
property:LEFT;
return type:int
special:static
content:ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น เป็นรูปแบบการจัดเรียง component ที่เริ่มจากทางซ้ายมือ
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.LEFT );
property:RIGHT;
return type:int
special:static
content:ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น เป็นรูปแบบการจัดเรียง component ที่เริ่มจากทางขวามือ
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.RIGHT );
property:CENTER;
return type:int
special:static
content:ใช้คืนค่า ตัวเลข ที่เป็นค่าคงที่ ที่แทนความหมายว่าเป็น เป็นรูปแบบการจัดเรียง component ที่เริ่มจากทางตรงกลาง
example:FlowLayout flowlayout = new FlowLayout ( FlowLayout.CENTER );