protected class

JRootPane.RootLayout

extends Object
implements LayoutManager2 Serializable
java.lang.Object
   ↳ javax.swing.JRootPane.RootLayout

Class Overview

A custom layout manager that is responsible for the layout of layeredPane, glassPane, and menuBar.

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.

Summary

Protected Constructors
JRootPane.RootLayout()
Public Methods
void addLayoutComponent(String name, Component comp)
If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
void addLayoutComponent(Component comp, Object constraints)
Adds the specified component to the layout, using the specified constraint object.
float getLayoutAlignmentX(Container target)
Returns the alignment along the x axis.
float getLayoutAlignmentY(Container target)
Returns the alignment along the y axis.
void invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
void layoutContainer(Container parent)
Instructs the layout manager to perform the layout for the specified container.
Dimension maximumLayoutSize(Container target)
Returns the maximum amount of space the layout can use.
Dimension minimumLayoutSize(Container parent)
Returns the minimum amount of space the layout needs.
Dimension preferredLayoutSize(Container parent)
Returns the amount of space the layout would like to have.
void removeLayoutComponent(Component comp)
Removes the specified component from the layout.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.awt.LayoutManager
From interface java.awt.LayoutManager2

Protected Constructors

protected JRootPane.RootLayout ()

Public Methods

public void addLayoutComponent (String name, Component comp)

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

Parameters
name the string to be associated with the component
comp the component to be added

public void addLayoutComponent (Component comp, Object constraints)

Adds the specified component to the layout, using the specified constraint object.

Parameters
comp the component to be added
constraints where/how the component is added to the layout.

public float getLayoutAlignmentX (Container target)

Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

public float getLayoutAlignmentY (Container target)

Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

public void invalidateLayout (Container target)

Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

public void layoutContainer (Container parent)

Instructs the layout manager to perform the layout for the specified container.

Parameters
parent the Container for which this layout manager is being used

public Dimension maximumLayoutSize (Container target)

Returns the maximum amount of space the layout can use.

Parameters
target the Container for which this layout manager is being used
Returns
  • a Dimension object containing the layout's maximum size

public Dimension minimumLayoutSize (Container parent)

Returns the minimum amount of space the layout needs.

Parameters
parent the Container for which this layout manager is being used
Returns
  • a Dimension object containing the layout's minimum size

public Dimension preferredLayoutSize (Container parent)

Returns the amount of space the layout would like to have.

Parameters
parent the Container for which this layout manager is being used
Returns
  • a Dimension object containing the layout's preferred size

public void removeLayoutComponent (Component comp)

Removes the specified component from the layout.

Parameters
comp the component to be removed