| new JLabel() | ใช้สร้าง object jlabel |
|---|---|
| new JLabel ( object_icon ) | ใช้สร้าง object jlabel โดยมี icon ที่กำหนด |
| new JLabel ( object_icon, swing_constants ) | ใช้สร้าง object jlabel โดยมี icon ที่กำหนด และได้กำหนดรูปแบบการจัดวาง icon ไว้ด้วย |
| new JLabel ( object_string ) | ใช้สร้าง object jlabel โดยมี ข้อความ ที่กำหนด |
| new JLabel ( object_string, object_icon, swing_constants ) | ใช้สร้าง object jlabel โดยมี ข้อความ และ icon ที่กำหนด และได้กำหนดรูปแบบการจัดวาง ข้อความและicon ไว้ด้วย |
| new JLabel ( object_string, swing_constants ) | ใช้สร้าง object jlabel โดยมี ข้อความ ที่กำหนด และได้กำหนดรูปแบบการจัดวาง ข้อความ ไว้ด้วย |
| setText() | ใช้กำหนด ข้อความ ให้กับ Jlabel |
| getText() | ใช้คืนค่า ข้อความ ของ Jlabel |
| setIcon() | ใช้กำหนด icon ให้กับ Jlabel |
| getIcon() | ใช้คืนค่า icon ของ Jlabel |
| setHorizontalTextPosition() | ใช้กำหนด รูปแบบการจัดวาง ข้อความและ icon บน jlabel ในตำแหน่งแนวนอน |
| setVerticalTextPosition() | ใช้กำหนด รูปแบบการจัดวาง ข้อความและ icon บน jlabel ในตำแหน่งแนวตั้ง |
method:new JLabel ();
return type:JLabel
content:ใช้สร้าง object jlabel
example:JLabel label = new JLabel ();
method:new JLabel ( object_icon );
return type:JLabel
content:ใช้สร้าง object jlabel โดยมี icon ที่กำหนด
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JLabel label = new JLabel ( icon );
method:new JLabel ( object_icon, swing_constants );
return type:JLabel
content:ใช้สร้าง object jlabel โดยมี icon ที่กำหนด และได้กำหนดรูปแบบการจัดวาง icon ไว้ด้วย
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JLabel label = new JLabel ( icon, SwingContants.RIGHT );
method:new JLabel ( object_string );
return type:JLabel
content:ใช้สร้าง object jlabel โดยมี ข้อความ ที่กำหนด
example:String text_label = new String ( "Name :" ); JLabel label = new JLabel ( text_label );
method:new JLabel ( object_string, object_icon, swing_constants );
return type:JLabel
content:ใช้สร้าง object jlabel โดยมี ข้อความ และ icon ที่กำหนด และได้กำหนดรูปแบบการจัดวาง ข้อความและicon ไว้ด้วย
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JLabel label = new JLabel ( "Name :", icon, SwingContants.RIGHT );
method:new JLabel ( object_string, swing_constants );
return type:JLabel
content:ใช้สร้าง object jlabel โดยมี ข้อความ ที่กำหนด และได้กำหนดรูปแบบการจัดวาง ข้อความ ไว้ด้วย
example:String text_label = new String ( "Name :" ); JLabel label = new JLabel ( text_label, SwingContants.RIGHT );
method:setText ( object_string );
return type:void
content:ใช้กำหนด ข้อความ ให้กับ Jlabel
example:JLabel label = new JLabel (); label.setText ( "Name :" );
method:getText ();
return type:String
content:ใช้คืนค่า ข้อความ ของ Jlabel
example:JLabel label = new JLabel (); label.setText ( "Name :" ); String text_label = label.getText ();
method:setIcon ( object_icon );
return type:void
content:ใช้กำหนด icon ให้กับ Jlabel
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JLabel label = new JLabel (); label.setIcon ( icon );
method:getIcon ();
return type:ImageIcon
content:ใช้คืนค่า icon ของ Jlabel
example:ImageIcon icon = new ImageIcon ( "C:/bamboo.gif" ); JLabel label = new JLabel (); label.setIcon ( icon ); ImageIcon icon_label = label.getIcon ();
method:setHorizontalTextPosition ( swing_constant );
return type:void
content:ใช้กำหนด รูปแบบการจัดวาง ข้อความและ icon บน jlabel ในตำแหน่งแนวนอน
example:JLabel label = new JLabel (); label.setText ( "Name :" ); label.setHorizontalTextPosition ( SwingConstants.CENTER );
method:setVerticalTextPosition ( swing_constant );
return type:void
content:ใช้กำหนด รูปแบบการจัดวาง ข้อความและ icon บน jlabel ในตำแหน่งแนวตั้ง
example:JLabel label = new JLabel (); label.setText ( "Name :" ); label.setVerticalTextPosition ( SwingConstants.TOP );