| new JButton () | ใช้สร้าง object jbutton |
|---|---|
| new JButton ( object_string ) | ใช้สร้าง object jbutton โดยมีการกำหนดข้อความ บนปุ่ม |
| new JButton ( object_icon ) | ใช้สร้าง object jbutton โดยมีการกำหนด icon บนปุ่ม |
| new JButton ( object_string, object_icon ) | ใช้สร้าง object jbutton โดยมีการกำหนด ข้อความ และ icon บนปุ่ม |
| setLabel() | ใช้กำหนด ข้อความ ให้กับ Jbutton |
| getLabel() | ใช้คืนค่า ข้อความ ของ Jbutton |
| setIcon() | ใช้กำหนด icon ให้กับ Jbutton |
| getIcon() | ใช้คืนค่า icon ของ Jbutton |
method:new JButton ();
return type:JButton
content:ใช้สร้าง object jbutton
example:JButton button = new JButton ();
method:new JButton ( object_string );
return type:JButton
content:ใช้สร้าง object jbutton โดยมีการกำหนดข้อความ บนปุ่ม
example:JButton button = new JButton ( "cancel" );
method:new JButton ( object_icon );
return type:JButton
content:ใช้สร้าง object jbutton โดยมีการกำหนด icon บนปุ่ม
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JButton button = new JButton ( icon );
method:new JButton ( object_string, object_icon );
return type:JButton
content:ใช้สร้าง object jbutton โดยมีการกำหนด ข้อความ และ icon บนปุ่ม
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JButton button = new JButton ( "cancel", icon );
method:setLabel ( object_string );
return type:void
content:ใช้กำหนด ข้อความ ให้กับ Jbutton
example:JButton button = new JButton (); button.setLabel ( "cancel" );
method:getLabel ();
return type:String
content:ใช้คืนค่า ข้อความ ของ Jbutton
example:JButton button = new JButton (); button.setLabel ( "cancel" ); String text_button = button.getLabel ();
method:setIcon ( object_icon );
return type:void
content:ใช้กำหนด icon ให้กับ Jbutton
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JButton button = new JButton (); button.setIcon ( icon );
method:getIcon ();
return type:ImageIcon
content:ใช้คืนค่า icon ของ Jbutton
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JButton button = new JButton (); button.setIcon ( icon ); ImageIcon icon_button = button.getIcon ();