| setMaximumSize() | ใช้กำหนด maximum size ให้กับ jcomponent ในรูปแบบของ dimension |
|---|---|
| getMaximumSize() | ใช้คืนค่า maximum size ของ jcomponent ในรูปแบบของ dimension |
| setMinimumSize() | ใช้กำหนด minimum size ให้กับ jcomponent ในรูปแบบของ dimension |
| getMinimumSize() | ใช้คืนค่า minimum size ของ jcomponent ในรูปแบบของ dimension |
| setPreferredSize() | ใช้กำหนด preferred size ให้กับ jcomponent ในรูปแบบของ dimension |
| getPreferredSize() | ใช้คืนค่า preferred size ของ jcomponent ในรูปแบบของ dimension |
| setToolTipText() | ใช้กำหนด ข้อความอธิบาย เมื่อนำเมาส์ไปอยู่เหนือ jcomponent นั้นๆ |
| getToolTipText() | ใช้คืนค่า ข้อความอธิบาย เมื่อนำเมาส์ไปอยู่เหนือ jcomponent |
| setCursor() | ใช้กำหนด cursor ให้กับ jcomponent เมื่อนำเมาส์ไปอยู่เหนือ jcomponent นั้นๆ |
| getDefaultCursor() | ใช้คืนค่า default cursor ของ jcomponent |
| setBorder() | ใช้กำหนดรูปแบบของ เส้นขอบ ให้กับ jcomponent |
| getBorder() | ใช้คืนค่า object border ของ jcomponent |
| getHeight() | ใช้คืนค่า ขนาดความสูง ของ jcomponent |
| getWidth() | ใช้คืนค่า ขนาดความกว้าง ของ jcomponent |
method:setMaximumSize ( object_dimension );
return type:void
content:ใช้กำหนด maximum size ให้กับ jcomponent ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); Dimension dimension = new Dimension ( 120, 30 ); button.setMaximumSize ( dimension );
method:getMaximumSize ();
return type:Dimension
content:ใช้คืนค่า maximum size ของ jcomponent ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); button.setBounds ( 0, 0 150, 30 ); Dimension maximum_size = button.getMaximumSize ();
method:setMinimumSize ( object_dimension );
return type:void
content:ใช้กำหนด minimum size ให้กับ jcomponent ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); Dimension dimension = new Dimension ( 120, 30 ); button.setMinimumSize ( dimension );
method:getMinimumSize ();
return type:Dimension
content:ใช้คืนค่า minimum size ของ jcomponent ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); button.setBounds ( 0, 0 150, 30 ); Dimension minimum_size = button.getMinimumSize ();
method:setPreferredSize ( object_dimension );
return type:void
content:ใช้กำหนด preferred size ให้กับ jcomponent ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); Dimension dimension = new Dimension ( 120, 30 ); button.setPreferredSize ( dimension );
method:getPreferredSize ();
return type:Dimension
content:ใช้คืนค่า preferred size ของ jcomponent ในรูปแบบของ dimension
example:JButton button = new JButton ( "cancel" ); button.setBounds ( 0, 0 150, 30 ); Dimension preferred_size = button.getPreferredSize ();
method:setToolTipText ( object_string );
return type:void
content:ใช้กำหนด ข้อความอธิบาย เมื่อนำเมาส์ไปอยู่เหนือ jcomponent นั้นๆ
example:JButton button = new JButton ( "cancel" ); button.setToolTipText ( "cancel" );
method:getToolTipText ();
return type:String
content:ใช้คืนค่า ข้อความอธิบาย เมื่อนำเมาส์ไปอยู่เหนือ jcomponent
example:JButton button = new JButton ( "cancel" ); button.setToolTipText ( "cancel" ); String tool_tip_text = button.getToolTipText ();
method:setCursor ( object_cursor );
return type:void
content:ใช้กำหนด cursor ให้กับ jcomponent เมื่อนำเมาส์ไปอยู่เหนือ jcomponent นั้นๆ
example:JButton button = new JButton ( "cancel" ); Cursor cursor = new Cursor ( Cursor.WAIT_CURSOR ); button.setCursor ( cursor );
method:getDefaultCursor ();
return type:Cursor
content:ใช้คืนค่า default cursor ของ jcomponent
example:JButton button = new JButton ( "cancel" ); Cursor default_cursor = button.getDefaultCursor ();
method:setBorder ( object_border );
return type:void
content:ใช้กำหนดรูปแบบของ เส้นขอบ ให้กับ jcomponent
example:JButton button = new JButton ( "cancel" ); Border etched_border = BorderFactory.createEtchedBorder (); Border title_border = BorderFactory.createTitledBorder ( etched_border, "Process" ); Border empty_border = BorderFactory.createEmptyBorder ( 10, 10, 10, 10 ); Border compound_border = BorderFactory.createCompoundBorder ( title_border, empty_border ); button.setBorder ( compound_border );
method:getBorder ();
return type:Border
content:ใช้คืนค่า object border ของ jcomponent
example:JButton button = new JButton ( "cancel" ); Border border_button = button.getBorder ();
method:getHeight ();
return type:int
content:ใช้คืนค่า ขนาดความสูง ของ jcomponent
example:JButton button = new JButton ( "cancel" ); int height = button.getHeight ();
method:getWidth ();
return type:int
content:ใช้คืนค่า ขนาดความกว้าง ของ jcomponent
example:JButton button = new JButton ( "cancel" ); int width = button.getWidth ();