javax.swing
Class ViewportLayout

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.ViewportLayout
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

public class ViewportLayout
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 , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

The default layout manager for JViewport. ViewportLayout defines a policy for layout that should be useful for most applications. The viewport makes its view the same size as the viewport, however it will not make the view smaller than its minimum size. As the viewport grows the view is kept bottom justified until the entire view is visible, subsequently the view is kept top justified.

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:
Serialized Form

Constructor Summary
ViewportLayout sample code for javax.swing.ViewportLayout.ViewportLayout() definition code for javax.swing.ViewportLayout.ViewportLayout() ()
           
 
Method Summary
 void addLayoutComponent sample code for javax.swing.ViewportLayout.addLayoutComponent(java.lang.String, java.awt.Component) definition code for javax.swing.ViewportLayout.addLayoutComponent(java.lang.String, java.awt.Component) (String sample code for java.lang.String definition code for java.lang.String  name, Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Adds the specified component to the layout.
 void layoutContainer sample code for javax.swing.ViewportLayout.layoutContainer(java.awt.Container) definition code for javax.swing.ViewportLayout.layoutContainer(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  parent)
          Called by the AWT when the specified container needs to be laid out.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension minimumLayoutSize sample code for javax.swing.ViewportLayout.minimumLayoutSize(java.awt.Container) definition code for javax.swing.ViewportLayout.minimumLayoutSize(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  parent)
          Returns the minimum dimensions needed to layout the components contained in the specified target container.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension preferredLayoutSize sample code for javax.swing.ViewportLayout.preferredLayoutSize(java.awt.Container) definition code for javax.swing.ViewportLayout.preferredLayoutSize(java.awt.Container) (Container sample code for java.awt.Container definition code for java.awt.Container  parent)
          Returns the preferred dimensions for this layout given the components in the specified target container.
 void removeLayoutComponent sample code for javax.swing.ViewportLayout.removeLayoutComponent(java.awt.Component) definition code for javax.swing.ViewportLayout.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.
 
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)
 

Constructor Detail

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

public ViewportLayout()
Method Detail

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

public void addLayoutComponent(String sample code for java.lang.String definition code for java.lang.String  name,
                               Component sample code for java.awt.Component definition code for java.awt.Component  c)
Adds the specified component to the layout. Not used by this class.

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:
name - the name of the component
c - the the component to be added

removeLayoutComponent sample code for javax.swing.ViewportLayout.removeLayoutComponent(java.awt.Component) definition code for javax.swing.ViewportLayout.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. Not used by this class.

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

preferredLayoutSize sample code for javax.swing.ViewportLayout.preferredLayoutSize(java.awt.Container) definition code for javax.swing.ViewportLayout.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)
Returns the preferred dimensions for this layout given the components in the specified target container.

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 component which needs to be laid out
Returns:
a Dimension object containing the preferred dimensions
See Also:
minimumLayoutSize(java.awt.Container) sample code for javax.swing.ViewportLayout.minimumLayoutSize(java.awt.Container) definition code for javax.swing.ViewportLayout.minimumLayoutSize(java.awt.Container)

minimumLayoutSize sample code for javax.swing.ViewportLayout.minimumLayoutSize(java.awt.Container) definition code for javax.swing.ViewportLayout.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)
Returns the minimum dimensions needed to layout the components contained in the specified target container.

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 component which needs to be laid out
Returns:
a Dimension object containing the minimum dimensions
See Also:
preferredLayoutSize(java.awt.Container) sample code for javax.swing.ViewportLayout.preferredLayoutSize(java.awt.Container) definition code for javax.swing.ViewportLayout.preferredLayoutSize(java.awt.Container)

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

public void layoutContainer(Container sample code for java.awt.Container definition code for java.awt.Container  parent)
Called by the AWT when the specified container needs to be laid out.

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
Throws:
AWTError - if the target isn't the container specified to the BoxLayout constructor