| new Frame() | ใช้สร้าง object frame โดยไม่มีการกำหนด title bar |
|---|---|
| new Frame( object_string_title_bar ) | ใช้สร้าง object frame โดยมี title bar ตามที่กำหนด |
| setTitle() | ใช้กำหนดข้อความที่เป็น title bar |
| getTitle() | ใช้คืนค่าข้อความของ title bar |
| setIconImage() | ใช้กำหนด icon ให้กับ frame |
| setMenuBar() | ใช้กำหนด menu bar ให้กับ frame |
| setMaximizedBounds() | ใช้กำหนดขนาดของ frame เมื่อมีการคลิกที่ปุ่ม maximum |
| setResizable() | ใช้กำหนดว่าจะให้ frame สามารถปรับขนาดได้หรือไม่ |
| show() | ใช้กำหนดให้แสดง frame |
| hide() | ใช้กำหนดให้ซ่อน frame |
method:new Frame ();
return type:Frame
content:ใช้สร้าง object frame โดยไม่มีการกำหนด title bar
example:Frame frame = new Frame ();
method:new Frame ( object_string_title_bar );
return type:Frame
content:ใช้สร้าง object frame โดยมี title bar ตามที่กำหนด
example:Frame frame = new Frame ( "ข้อมูลการกำหนดสิทธิ" );
method:setTitle ( object_string_title_bar );
return type:void
content:ใช้กำหนดข้อความที่เป็น title bar
example:Frame frame = new Frame (); frame.setTitle ( "ข้อมูลการกำหนดสิทธิ" );
method:getTitle ();
return type:String
content:ใช้คืนค่าข้อความของ title bar
example:Frame frame = new Frame ( "ข้อมูลการกำหนดสิทธิ" ); String title_bar = frame.getTitle ();
method:setIconImage ( object_image_icon );
return type:void
content:ใช้กำหนด icon ให้กับ frame
example:Frame frame = new Frame (); Icon icon = new ImageIcon ( "C:/panda.png" ); frame.setIconImage ( icon );
method:setMenuBar ( object_menu_bar );
return type:void
content:ใช้กำหนด menu bar ให้กับ frame
example:Frame frame = new Frame (); JMenuBar menu_bar = new JMenuBar (); menu_bar.add ( new JMenu ( "ข้อมูลหลัก" ) ); frame.setMenuBar ( menu_bar );
method:setMaximizedBounds ( object_rectangle );
return type:void
content:ใช้กำหนดขนาดของ frame เมื่อมีการคลิกที่ปุ่ม maximum
example:Frame frame = new Frame (); Rectangle rectangle = new Rectangle ( 30, 40, 500, 200 ); frame.setMaximizedBounds ( rectangle );
method:setResizable ( boolean );
return type:void
content:ใช้กำหนดว่าจะให้ frame สามารถปรับขนาดได้หรือไม่
example:Frame frame = new Frame (); frame.setResizable ( false );
method:show ();
return type:void
content:ใช้กำหนดให้แสดง frame
example:Frame frame = new Frame (); frame.show (); // frame.setVisible ( true );
method:hide ();
return type:void
content:ใช้กำหนดให้ซ่อน frame
example:Frame frame = new Frame (); frame.hide (); // frame.setVisible ( false );