javax.swing
Class ScrollPaneLayout

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.ScrollPaneLayout
All Implemented Interfaces:
LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , ScrollPaneConstants sample code for javax.swing.ScrollPaneConstants definition code for javax.swing.ScrollPaneConstants
Direct Known Subclasses:
ScrollPaneLayout.UIResource sample code for javax.swing.ScrollPaneLayout.UIResource definition code for javax.swing.ScrollPaneLayout.UIResource

public class ScrollPaneLayout
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager , ScrollPaneConstants sample code for javax.swing.ScrollPaneConstants definition code for javax.swing.ScrollPaneConstants , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

The layout manager used by JScrollPane. JScrollPaneLayout is responsible for nine components: a viewport, two scrollbars, a row header, a column header, and four "corner" components.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane , JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport , Serialized Form

Nested Class Summary
static class ScrollPaneLayout.UIResource sample code for javax.swing.ScrollPaneLayout.UIResource definition code for javax.swing.ScrollPaneLayout.UIResource
          The UI resource version of ScrollPaneLayout.
 
Field Summary
protected  JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport colHead sample code for javax.swing.ScrollPaneLayout.colHead definition code for javax.swing.ScrollPaneLayout.colHead
          The column header child.
protected  JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar hsb sample code for javax.swing.ScrollPaneLayout.hsb definition code for javax.swing.ScrollPaneLayout.hsb
          The scrollpane's horizontal scrollbar child.
protected  int hsbPolicy sample code for javax.swing.ScrollPaneLayout.hsbPolicy definition code for javax.swing.ScrollPaneLayout.hsbPolicy
          The display policy for the horizontal scrollbar.
protected  Component sample code for java.awt.Component definition code for java.awt.Component lowerLeft sample code for javax.swing.ScrollPaneLayout.lowerLeft definition code for javax.swing.ScrollPaneLayout.lowerLeft
          The component to display in the lower left corner.
protected  Component sample code for java.awt.Component definition code for java.awt.Component lowerRight sample code for javax.swing.ScrollPaneLayout.lowerRight definition code for javax.swing.ScrollPaneLayout.lowerRight
          The component to display in the lower right corner.
protected  JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport rowHead sample code for javax.swing.ScrollPaneLayout.rowHead definition code for javax.swing.ScrollPaneLayout.rowHead
          The row header child.
protected  Component sample code for java.awt.Component definition code for java.awt.Component upperLeft sample code for javax.swing.ScrollPaneLayout.upperLeft definition code for javax.swing.ScrollPaneLayout.upperLeft
          The component to display in the upper left corner.
protected  Component sample code for java.awt.Component definition code for java.awt.Component upperRight sample code for javax.swing.ScrollPaneLayout.upperRight definition code for javax.swing.ScrollPaneLayout.upperRight
          The component to display in the upper right corner.
protected  JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport viewport sample code for javax.swing.ScrollPaneLayout.viewport definition code for javax.swing.ScrollPaneLayout.viewport
          The scrollpane's viewport child.
protected  JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar vsb sample code for javax.swing.ScrollPaneLayout.vsb definition code for javax.swing.ScrollPaneLayout.vsb
          The scrollpane's vertical scrollbar child.
protected  int vsbPolicy sample code for javax.swing.ScrollPaneLayout.vsbPolicy definition code for javax.swing.ScrollPaneLayout.vsbPolicy
          The display policy for the vertical scrollbar.
 
Fields inherited from interface javax.swing.ScrollPaneConstants sample code for javax.swing.ScrollPaneConstants definition code for javax.swing.ScrollPaneConstants
COLUMN_HEADER sample code for javax.swing.ScrollPaneConstants.COLUMN_HEADER definition code for javax.swing.ScrollPaneConstants.COLUMN_HEADER , HORIZONTAL_SCROLLBAR sample code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR definition code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR , HORIZONTAL_SCROLLBAR_ALWAYS sample code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS definition code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS , HORIZONTAL_SCROLLBAR_AS_NEEDED sample code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED definition code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED , HORIZONTAL_SCROLLBAR_NEVER sample code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER definition code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER , HORIZONTAL_SCROLLBAR_POLICY sample code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_POLICY definition code for javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_POLICY , LOWER_LEADING_CORNER sample code for javax.swing.ScrollPaneConstants.LOWER_LEADING_CORNER definition code for javax.swing.ScrollPaneConstants.LOWER_LEADING_CORNER , LOWER_LEFT_CORNER sample code for javax.swing.ScrollPaneConstants.LOWER_LEFT_CORNER definition code for javax.swing.ScrollPaneConstants.LOWER_LEFT_CORNER , LOWER_RIGHT_CORNER sample code for javax.swing.ScrollPaneConstants.LOWER_RIGHT_CORNER definition code for javax.swing.ScrollPaneConstants.LOWER_RIGHT_CORNER , LOWER_TRAILING_CORNER sample code for javax.swing.ScrollPaneConstants.LOWER_TRAILING_CORNER definition code for javax.swing.ScrollPaneConstants.LOWER_TRAILING_CORNER , ROW_HEADER sample code for javax.swing.ScrollPaneConstants.ROW_HEADER definition code for javax.swing.ScrollPaneConstants.ROW_HEADER , UPPER_LEADING_CORNER sample code for javax.swing.ScrollPaneConstants.UPPER_LEADING_CORNER definition code for javax.swing.ScrollPaneConstants.UPPER_LEADING_CORNER , UPPER_LEFT_CORNER sample code for javax.swing.ScrollPaneConstants.UPPER_LEFT_CORNER definition code for javax.swing.ScrollPaneConstants.UPPER_LEFT_CORNER , UPPER_RIGHT_CORNER sample code for javax.swing.ScrollPaneConstants.UPPER_RIGHT_CORNER definition code for javax.swing.ScrollPaneConstants.UPPER_RIGHT_CORNER , UPPER_TRAILING_CORNER sample code for javax.swing.ScrollPaneConstants.UPPER_TRAILING_CORNER definition code for javax.swing.ScrollPaneConstants.UPPER_TRAILING_CORNER , VERTICAL_SCROLLBAR sample code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR definition code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR , VERTICAL_SCROLLBAR_ALWAYS sample code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS definition code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS , VERTICAL_SCROLLBAR_AS_NEEDED sample code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED definition code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED , VERTICAL_SCROLLBAR_NEVER sample code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER definition code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER , VERTICAL_SCROLLBAR_POLICY sample code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_POLICY definition code for javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_POLICY , VIEWPORT sample code for javax.swing.ScrollPaneConstants.VIEWPORT definition code for javax.swing.ScrollPaneConstants.VIEWPORT
 
Constructor Summary
ScrollPaneLayout sample code for javax.swing.ScrollPaneLayout.ScrollPaneLayout() definition code for javax.swing.ScrollPaneLayout.ScrollPaneLayout() ()
           
 
Method Summary
 void addLayoutComponent sample code for javax.swing.ScrollPaneLayout.addLayoutComponent(java.lang.String, java.awt.Component) definition code for javax.swing.ScrollPaneLayout.addLayoutComponent(java.lang.String, java.awt.Component) (String sample code for java.lang.String definition code for java.lang.String  s, Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Adds the specified component to the layout.
protected  Component sample code for java.awt.Component definition code for java.awt.Component addSingletonComponent sample code for javax.swing.ScrollPaneLayout.addSingletonComponent(java.awt.Component, java.awt.Component) definition code for javax.swing.ScrollPaneLayout.addSingletonComponent(java.awt.Component, java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  oldC, Component sample code for java.awt.Component definition code for java.awt.Component  newC)
          Removes an existing component.
 JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport getColumnHeader sample code for javax.swing.ScrollPaneLayout.getColumnHeader() definition code for javax.swing.ScrollPaneLayout.getColumnHeader() ()
          Returns the JViewport object that is the column header.
 Component sample code for java.awt.Component definition code for java.awt.Component getCorner sample code for javax.swing.ScrollPaneLayout.getCorner(java.lang.String) definition code for javax.swing.ScrollPaneLayout.getCorner(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  key)
          Returns the Component at the specified corner.
 JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar getHorizontalScrollBar sample code for javax.swing.ScrollPaneLayout.getHorizontalScrollBar() definition code for javax.swing.ScrollPaneLayout.getHorizontalScrollBar() ()
          Returns the JScrollBar object that handles horizontal scrolling.
 int getHorizontalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.getHorizontalScrollBarPolicy() definition code for javax.swing.ScrollPaneLayout.getHorizontalScrollBarPolicy() ()
          Returns the horizontal scrollbar-display policy.
 JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport getRowHeader sample code for javax.swing.ScrollPaneLayout.getRowHeader() definition code for javax.swing.ScrollPaneLayout.getRowHeader() ()
          Returns the JViewport object that is the row header.
 JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar getVerticalScrollBar sample code for javax.swing.ScrollPaneLayout.getVerticalScrollBar() definition code for javax.swing.ScrollPaneLayout.getVerticalScrollBar() ()
          Returns the JScrollBar object that handles vertical scrolling.
 int getVerticalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.getVerticalScrollBarPolicy() definition code for javax.swing.ScrollPaneLayout.getVerticalScrollBarPolicy() ()
          Returns the vertical scrollbar-display policy.
 JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport getViewport sample code for javax.swing.ScrollPaneLayout.getViewport() definition code for javax.swing.ScrollPaneLayout.getViewport() ()
          Returns the JViewport object that displays the scrollable contents.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getViewportBorderBounds sample code for javax.swing.ScrollPaneLayout.getViewportBorderBounds(javax.swing.JScrollPane) definition code for javax.swing.ScrollPaneLayout.getViewportBorderBounds(javax.swing.JScrollPane) (JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane  scrollpane)
          Deprecated. As of JDK version Swing1.1 replaced by JScrollPane.getViewportBorderBounds().
 void layoutContainer sample code for javax.swing.ScrollPaneLayout.layoutContainer(java.awt.Container) definition code for javax.swing.ScrollPaneLayout.layoutContainer(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  parent)
          Lays out the scrollpane.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension minimumLayoutSize sample code for javax.swing.ScrollPaneLayout.minimumLayoutSize(java.awt.Container) definition code for javax.swing.ScrollPaneLayout.minimumLayoutSize(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  parent)
          The minimum size of a ScrollPane is the size of the insets plus minimum size of the viewport, plus the scrollpane's viewportBorder insets, plus the minimum size of the visible headers, plus the minimum size of the scrollbars whose displayPolicy isn't NEVER.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension preferredLayoutSize sample code for javax.swing.ScrollPaneLayout.preferredLayoutSize(java.awt.Container) definition code for javax.swing.ScrollPaneLayout.preferredLayoutSize(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  parent)
          The preferred size of a ScrollPane is the size of the insets, plus the preferred size of the viewport, plus the preferred size of the visible headers, plus the preferred size of the scrollbars that will appear given the current view and the current scrollbar displayPolicies.
 void removeLayoutComponent sample code for javax.swing.ScrollPaneLayout.removeLayoutComponent(java.awt.Component) definition code for javax.swing.ScrollPaneLayout.removeLayoutComponent(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Removes the specified component from the layout.
 void setHorizontalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.setHorizontalScrollBarPolicy(int) definition code for javax.swing.ScrollPaneLayout.setHorizontalScrollBarPolicy(int) (int x)
          Sets the horizontal scrollbar-display policy.
 void setVerticalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.setVerticalScrollBarPolicy(int) definition code for javax.swing.ScrollPaneLayout.setVerticalScrollBarPolicy(int) (int x)
          Sets the vertical scrollbar-display policy.
 void syncWithScrollPane sample code for javax.swing.ScrollPaneLayout.syncWithScrollPane(javax.swing.JScrollPane) definition code for javax.swing.ScrollPaneLayout.syncWithScrollPane(javax.swing.JScrollPane) (JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane  sp)
          This method is invoked after the ScrollPaneLayout is set as the LayoutManager of a JScrollPane.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

viewport sample code for javax.swing.ScrollPaneLayout.viewport

protected JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport  viewport
The scrollpane's viewport child. Default is an empty JViewport.

See Also:
JScrollPane.setViewport(javax.swing.JViewport) sample code for javax.swing.JScrollPane.setViewport(javax.swing.JViewport) definition code for javax.swing.JScrollPane.setViewport(javax.swing.JViewport)

vsb sample code for javax.swing.ScrollPaneLayout.vsb

protected JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar  vsb
The scrollpane's vertical scrollbar child. Default is a JScrollBar.

See Also:
JScrollPane.setVerticalScrollBar(javax.swing.JScrollBar) sample code for javax.swing.JScrollPane.setVerticalScrollBar(javax.swing.JScrollBar) definition code for javax.swing.JScrollPane.setVerticalScrollBar(javax.swing.JScrollBar)

hsb sample code for javax.swing.ScrollPaneLayout.hsb

protected JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar  hsb
The scrollpane's horizontal scrollbar child. Default is a JScrollBar.

See Also:
JScrollPane.setHorizontalScrollBar(javax.swing.JScrollBar) sample code for javax.swing.JScrollPane.setHorizontalScrollBar(javax.swing.JScrollBar) definition code for javax.swing.JScrollPane.setHorizontalScrollBar(javax.swing.JScrollBar)

rowHead sample code for javax.swing.ScrollPaneLayout.rowHead

protected JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport  rowHead
The row header child. Default is null.

See Also:
JScrollPane.setRowHeader(javax.swing.JViewport) sample code for javax.swing.JScrollPane.setRowHeader(javax.swing.JViewport) definition code for javax.swing.JScrollPane.setRowHeader(javax.swing.JViewport)

colHead sample code for javax.swing.ScrollPaneLayout.colHead

protected JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport  colHead
The column header child. Default is null.

See Also:
JScrollPane.setColumnHeader(javax.swing.JViewport) sample code for javax.swing.JScrollPane.setColumnHeader(javax.swing.JViewport) definition code for javax.swing.JScrollPane.setColumnHeader(javax.swing.JViewport)

lowerLeft sample code for javax.swing.ScrollPaneLayout.lowerLeft

protected Component sample code for java.awt.Component definition code for java.awt.Component  lowerLeft
The component to display in the lower left corner. Default is null.

See Also:
JScrollPane.setCorner(java.lang.String, java.awt.Component) sample code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component) definition code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component)

lowerRight sample code for javax.swing.ScrollPaneLayout.lowerRight

protected Component sample code for java.awt.Component definition code for java.awt.Component  lowerRight
The component to display in the lower right corner. Default is null.

See Also:
JScrollPane.setCorner(java.lang.String, java.awt.Component) sample code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component) definition code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component)

upperLeft sample code for javax.swing.ScrollPaneLayout.upperLeft

protected Component sample code for java.awt.Component definition code for java.awt.Component  upperLeft
The component to display in the upper left corner. Default is null.

See Also:
JScrollPane.setCorner(java.lang.String, java.awt.Component) sample code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component) definition code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component)

upperRight sample code for javax.swing.ScrollPaneLayout.upperRight

protected Component sample code for java.awt.Component definition code for java.awt.Component  upperRight
The component to display in the upper right corner. Default is null.

See Also:
JScrollPane.setCorner(java.lang.String, java.awt.Component) sample code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component) definition code for javax.swing.JScrollPane.setCorner(java.lang.String, java.awt.Component)

vsbPolicy sample code for javax.swing.ScrollPaneLayout.vsbPolicy

protected int vsbPolicy
The display policy for the vertical scrollbar. The default is JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED.

This field is obsolete, please use the JScrollPane field instead.

See Also:
JScrollPane.setVerticalScrollBarPolicy(int) sample code for javax.swing.JScrollPane.setVerticalScrollBarPolicy(int) definition code for javax.swing.JScrollPane.setVerticalScrollBarPolicy(int)

hsbPolicy sample code for javax.swing.ScrollPaneLayout.hsbPolicy

protected int hsbPolicy
The display policy for the horizontal scrollbar. The default is JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED.

This field is obsolete, please use the JScrollPane field instead.

See Also:
JScrollPane.setHorizontalScrollBarPolicy(int) sample code for javax.swing.JScrollPane.setHorizontalScrollBarPolicy(int) definition code for javax.swing.JScrollPane.setHorizontalScrollBarPolicy(int)
Constructor Detail

ScrollPaneLayout sample code for javax.swing.ScrollPaneLayout() definition code for javax.swing.ScrollPaneLayout()

public ScrollPaneLayout()
Method Detail

syncWithScrollPane sample code for javax.swing.ScrollPaneLayout.syncWithScrollPane(javax.swing.JScrollPane) definition code for javax.swing.ScrollPaneLayout.syncWithScrollPane(javax.swing.JScrollPane)

public void syncWithScrollPane(JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane  sp)
This method is invoked after the ScrollPaneLayout is set as the LayoutManager of a JScrollPane. It initializes all of the internal fields that are ordinarily set by addLayoutComponent. For example:
 ScrollPaneLayout mySPLayout = new ScrollPanelLayout() {
     public void layoutContainer(Container p) {
         super.layoutContainer(p);
         // do some extra work here ...
     }
 };
 scrollpane.setLayout(mySPLayout):
 


addSingletonComponent sample code for javax.swing.ScrollPaneLayout.addSingletonComponent(java.awt.Component, java.awt.Component) definition code for javax.swing.ScrollPaneLayout.addSingletonComponent(java.awt.Component, java.awt.Component)

protected Component sample code for java.awt.Component definition code for java.awt.Component  addSingletonComponent(Component sample code for java.awt.Component definition code for java.awt.Component  oldC,
                                          Component sample code for java.awt.Component definition code for java.awt.Component  newC)
Removes an existing component. When a new component, such as the left corner, or vertical scrollbar, is added, the old one, if it exists, must be removed.

This method returns newC. If oldC is not equal to newC and is non-null, it will be removed from its parent.

Parameters:
oldC - the Component to replace
newC - the Component to add
Returns:
the newC

addLayoutComponent sample code for javax.swing.ScrollPaneLayout.addLayoutComponent(java.lang.String, java.awt.Component) definition code for javax.swing.ScrollPaneLayout.addLayoutComponent(java.lang.String, java.awt.Component)

public void addLayoutComponent(String sample code for java.lang.String definition code for java.lang.String  s,
                               Component sample code for java.awt.Component definition code for java.awt.Component  c)
Adds the specified component to the layout. The layout is identified using one of:

Specified by:
addLayoutComponent sample code for java.awt.LayoutManager.addLayoutComponent(java.lang.String, java.awt.Component) definition code for java.awt.LayoutManager.addLayoutComponent(java.lang.String, java.awt.Component) in interface LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
Parameters:
s - the component identifier
c - the the component to be added
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if s is an invalid key

removeLayoutComponent sample code for javax.swing.ScrollPaneLayout.removeLayoutComponent(java.awt.Component) definition code for javax.swing.ScrollPaneLayout.removeLayoutComponent(java.awt.Component)

public void removeLayoutComponent(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent sample code for java.awt.LayoutManager.removeLayoutComponent(java.awt.Component) definition code for java.awt.LayoutManager.removeLayoutComponent(java.awt.Component) in interface LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
Parameters:
c - the component to remove

getVerticalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.getVerticalScrollBarPolicy() definition code for javax.swing.ScrollPaneLayout.getVerticalScrollBarPolicy()

public int getVerticalScrollBarPolicy()
Returns the vertical scrollbar-display policy.

Returns:
an integer giving the display policy
See Also:
setVerticalScrollBarPolicy(int) sample code for javax.swing.ScrollPaneLayout.setVerticalScrollBarPolicy(int) definition code for javax.swing.ScrollPaneLayout.setVerticalScrollBarPolicy(int)

setVerticalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.setVerticalScrollBarPolicy(int) definition code for javax.swing.ScrollPaneLayout.setVerticalScrollBarPolicy(int)

public void setVerticalScrollBarPolicy(int x)
Sets the vertical scrollbar-display policy. The options are: Note: Applications should use the JScrollPane version of this method. It only exists for backwards compatibility with the Swing 1.0.2 (and earlier) versions of this class.

Parameters:
x - an integer giving the display policy
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if x is an invalid vertical scroll bar policy, as listed above

getHorizontalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.getHorizontalScrollBarPolicy() definition code for javax.swing.ScrollPaneLayout.getHorizontalScrollBarPolicy()

public int getHorizontalScrollBarPolicy()
Returns the horizontal scrollbar-display policy.

Returns:
an integer giving the display policy
See Also:
setHorizontalScrollBarPolicy(int) sample code for javax.swing.ScrollPaneLayout.setHorizontalScrollBarPolicy(int) definition code for javax.swing.ScrollPaneLayout.setHorizontalScrollBarPolicy(int)

setHorizontalScrollBarPolicy sample code for javax.swing.ScrollPaneLayout.setHorizontalScrollBarPolicy(int) definition code for javax.swing.ScrollPaneLayout.setHorizontalScrollBarPolicy(int)

public void setHorizontalScrollBarPolicy(int x)
Sets the horizontal scrollbar-display policy. The options are: Note: Applications should use the JScrollPane version of this method. It only exists for backwards compatibility with the Swing 1.0.2 (and earlier) versions of this class.

Parameters:
x - an int giving the display policy
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if x is not a valid horizontal scrollbar policy, as listed above

getViewport sample code for javax.swing.ScrollPaneLayout.getViewport() definition code for javax.swing.ScrollPaneLayout.getViewport()

public JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport  getViewport()
Returns the JViewport object that displays the scrollable contents.

Returns:
the JViewport object that displays the scrollable contents
See Also:
JScrollPane.getViewport() sample code for javax.swing.JScrollPane.getViewport() definition code for javax.swing.JScrollPane.getViewport()

getHorizontalScrollBar sample code for javax.swing.ScrollPaneLayout.getHorizontalScrollBar() definition code for javax.swing.ScrollPaneLayout.getHorizontalScrollBar()

public JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar  getHorizontalScrollBar()
Returns the JScrollBar object that handles horizontal scrolling.

Returns:
the JScrollBar object that handles horizontal scrolling
See Also:
JScrollPane.getHorizontalScrollBar() sample code for javax.swing.JScrollPane.getHorizontalScrollBar() definition code for javax.swing.JScrollPane.getHorizontalScrollBar()

getVerticalScrollBar sample code for javax.swing.ScrollPaneLayout.getVerticalScrollBar() definition code for javax.swing.ScrollPaneLayout.getVerticalScrollBar()

public JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar  getVerticalScrollBar()
Returns the JScrollBar object that handles vertical scrolling.

Returns:
the JScrollBar object that handles vertical scrolling
See Also:
JScrollPane.getVerticalScrollBar() sample code for javax.swing.JScrollPane.getVerticalScrollBar() definition code for javax.swing.JScrollPane.getVerticalScrollBar()

getRowHeader sample code for javax.swing.ScrollPaneLayout.getRowHeader() definition code for javax.swing.ScrollPaneLayout.getRowHeader()

public JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport  getRowHeader()
Returns the JViewport object that is the row header.

Returns:
the JViewport object that is the row header
See Also:
JScrollPane.getRowHeader() sample code for javax.swing.JScrollPane.getRowHeader() definition code for javax.swing.JScrollPane.getRowHeader()

getColumnHeader sample code for javax.swing.ScrollPaneLayout.getColumnHeader() definition code for javax.swing.ScrollPaneLayout.getColumnHeader()

public JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport  getColumnHeader()
Returns the JViewport object that is the column header.

Returns:
the JViewport object that is the column header
See Also:
JScrollPane.getColumnHeader() sample code for javax.swing.JScrollPane.getColumnHeader() definition code for javax.swing.JScrollPane.getColumnHeader()

getCorner sample code for javax.swing.ScrollPaneLayout.getCorner(java.lang.String) definition code for javax.swing.ScrollPaneLayout.getCorner(java.lang.String)

public Component sample code for java.awt.Component definition code for java.awt.Component  getCorner(String sample code for java.lang.String definition code for java.lang.String  key)
Returns the Component at the specified corner.

Parameters:
key - the String specifying the corner
Returns:
the Component at the specified corner, as defined in ScrollPaneConstants sample code for javax.swing.ScrollPaneConstants definition code for javax.swing.ScrollPaneConstants ; if key is not one of the four corners, null is returned
See Also:
JScrollPane.getCorner(java.lang.String) sample code for javax.swing.JScrollPane.getCorner(java.lang.String) definition code for javax.swing.JScrollPane.getCorner(java.lang.String)

preferredLayoutSize sample code for javax.swing.ScrollPaneLayout.preferredLayoutSize(java.awt.Container) definition code for javax.swing.ScrollPaneLayout.preferredLayoutSize(java.awt.Container)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  preferredLayoutSize(Container sample code for java.awt.Container definition code for java.awt.Container  parent)
The preferred size of a ScrollPane is the size of the insets, plus the preferred size of the viewport, plus the preferred size of the visible headers, plus the preferred size of the scrollbars that will appear given the current view and the current scrollbar displayPolicies.

Note that the rowHeader is calculated as part of the preferred width and the colHeader is calculated as part of the preferred size.

Specified by:
preferredLayoutSize sample code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container) in interface LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
Parameters:
parent - the Container that will be laid out
Returns:
a Dimension object specifying the preferred size of the viewport and any scrollbars
See Also:
ViewportLayout sample code for javax.swing.ViewportLayout definition code for javax.swing.ViewportLayout , LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager

minimumLayoutSize sample code for javax.swing.ScrollPaneLayout.minimumLayoutSize(java.awt.Container) definition code for javax.swing.ScrollPaneLayout.minimumLayoutSize(java.awt.Container)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  minimumLayoutSize(Container sample code for java.awt.Container definition code for java.awt.Container  parent)
The minimum size of a ScrollPane is the size of the insets plus minimum size of the viewport, plus the scrollpane's viewportBorder insets, plus the minimum size of the visible headers, plus the minimum size of the scrollbars whose displayPolicy isn't NEVER.

Specified by:
minimumLayoutSize sample code for java.awt.LayoutManager.minimumLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.minimumLayoutSize(java.awt.Container) in interface LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
Parameters:
parent - the Container that will be laid out
Returns:
a Dimension object specifying the minimum size
See Also:
LayoutManager.preferredLayoutSize(java.awt.Container) sample code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container) definition code for java.awt.LayoutManager.preferredLayoutSize(java.awt.Container)

layoutContainer sample code for javax.swing.ScrollPaneLayout.layoutContainer(java.awt.Container) definition code for javax.swing.ScrollPaneLayout.layoutContainer(java.awt.Container)

public void layoutContainer(Container sample code for java.awt.Container definition code for java.awt.Container  parent)
Lays out the scrollpane. The positioning of components depends on the following constraints:

Specified by:
layoutContainer sample code for java.awt.LayoutManager.layoutContainer(java.awt.Container) definition code for java.awt.LayoutManager.layoutContainer(java.awt.Container) in interface LayoutManager sample code for java.awt.LayoutManager definition code for java.awt.LayoutManager
Parameters:
parent - the Container to lay out

getViewportBorderBounds sample code for javax.swing.ScrollPaneLayout.getViewportBorderBounds(javax.swing.JScrollPane) definition code for javax.swing.ScrollPaneLayout.getViewportBorderBounds(javax.swing.JScrollPane)

@Deprecated
public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getViewportBorderBounds(JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane  scrollpane)
Deprecated. As of JDK version Swing1.1 replaced by JScrollPane.getViewportBorderBounds().

Returns the bounds of the border around the specified scroll pane's viewport.

Returns:
the size and position of the viewport border