| new JScrollPane () | ใช้สร้าง Object JScrollPane โดยจะมี scrollbar ขึ้นมาทั้งแนวตั้งและแนวนอน เมื่อจำเป็น |
|---|---|
| new JScrollPane ( object_component ) | ใช้สร้าง Object JScrollPane โดยจะมี scrollbar ขึ้นมาทั้งแนวตั้งและแนวนอน เมื่อจำเป็น |
| new JScrollPane ( scrollpaneconstants_vertical, scrollpaneconstants_horizontal ) | ใช้สร้าง Object JScrollPane โดยมีการกำหนดคุณสมบัติของการมี scrollbar ทั้งแนวตั้งและแนวนอนไว้ด้วย |
| setViewportView() | ใช้กำหนด component ที่จะให้มีคุณสมบัติของการมี scrollbar ตามที่กำหนด |
method:new JScrollPane ();
return type:JScrollPane
content:ใช้สร้าง Object JScrollPane โดยจะมี scrollbar ขึ้นมาทั้งแนวตั้งและแนวนอน เมื่อจำเป็น
example:Container container = getContentPane (); JScrollPane scroll_pane = new JScrollPane (); container.add ( scroll_pane );
method:new JScrollPane ( object_component );
return type:JScrollPane
content:ใช้สร้าง Object JScrollPane โดยจะมี scrollbar ขึ้นมาทั้งแนวตั้งและแนวนอน เมื่อจำเป็น ให้กับ component ที่กำหนด
example:JScrollPane scroll_pane = new JScrollPane ( new JPanel () );
method:new JScrollPane ( scrollpaneconstants_vertical, scrollpaneconstants_horizontal );
return type:JScrollPane
content:ใช้สร้าง Object JScrollPane โดยมีการกำหนดคุณสมบัติของการมี scrollbar ทั้งแนวตั้งและแนวนอนไว้ด้วย
example:Container container = getContentPane (); int scroll_vertical = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; int scroll_horizontal = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER; JScrollPane scroll_pane = new JScrollPane ( scroll_vertical, scroll_horizontal ); container.add ( scroll_pane );
method:setViewportView ( object_component );
return type:void
content:ใช้กำหนด component ที่จะให้มีคุณสมบัติของการมี scrollbar ตามที่กำหนด
example:int scroll_vertical = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; int scroll_horizontal = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER; JScrollPane scroll_pane = new JScrollPane ( scroll_vertical, scroll_horizontal ); scroll_pane.setViewportView ( new JPanel () );