Class JRootPane.RootLayout
- All Implemented Interfaces:
-
LayoutManager
,LayoutManager2
,Serializable
- Enclosing class:
- JRootPane
protected class JRootPane.RootLayout extends Object implements LayoutManager2, Serializable
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 JavaBeans has been added to the java.beans
package. Please see XMLEncoder
.
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
protected |
Constructs a RootLayout . |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
void |
addLayoutComponent |
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent |
If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name . |
float |
getLayoutAlignmentX |
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY |
Returns the alignment along the y axis. |
void |
invalidateLayout |
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer |
Instructs the layout manager to perform the layout for the specified container. |
Dimension |
maximumLayoutSize |
Returns the maximum amount of space the layout can use. |
Dimension |
minimumLayoutSize |
Returns the minimum amount of space the layout needs. |
Dimension |
preferredLayoutSize |
Returns the amount of space the layout would like to have. |
void |
removeLayoutComponent |
Removes the specified component from the layout. |
Constructor Details
RootLayout
protected RootLayout()
RootLayout
.Method Details
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- Specified by:
-
preferredLayoutSize
in interfaceLayoutManager
- Parameters:
-
parent
- the Container for which this layout manager is being used - Returns:
- a Dimension object containing the layout's preferred size
- See Also:
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Specified by:
-
minimumLayoutSize
in interfaceLayoutManager
- Parameters:
-
parent
- the Container for which this layout manager is being used - Returns:
- a Dimension object containing the layout's minimum size
- See Also:
maximumLayoutSize
public Dimension maximumLayoutSize(Container target)
- Specified by:
-
maximumLayoutSize
in interfaceLayoutManager2
- Parameters:
-
target
- the Container for which this layout manager is being used - Returns:
- a Dimension object containing the layout's maximum size
- See Also:
layoutContainer
public void layoutContainer(Container parent)
- Specified by:
-
layoutContainer
in interfaceLayoutManager
- Parameters:
-
parent
- the Container for which this layout manager is being used
addLayoutComponent
public void addLayoutComponent(String name, Component comp)
LayoutManager
comp
to the layout, associating it with the string specified by name
.- Specified by:
-
addLayoutComponent
in interfaceLayoutManager
- Parameters:
-
name
- the string to be associated with the component -
comp
- the component to be added
removeLayoutComponent
public void removeLayoutComponent(Component comp)
LayoutManager
- Specified by:
-
removeLayoutComponent
in interfaceLayoutManager
- Parameters:
-
comp
- the component to be removed
addLayoutComponent
public void addLayoutComponent(Component comp, Object constraints)
LayoutManager2
- Specified by:
-
addLayoutComponent
in interfaceLayoutManager2
- Parameters:
-
comp
- the component to be added -
constraints
- where/how the component is added to the layout.
getLayoutAlignmentX
public float getLayoutAlignmentX(Container target)
LayoutManager2
- Specified by:
-
getLayoutAlignmentX
in interfaceLayoutManager2
- Parameters:
-
target
- the target container - Returns:
- the x-axis alignment preference
getLayoutAlignmentY
public float getLayoutAlignmentY(Container target)
LayoutManager2
- Specified by:
-
getLayoutAlignmentY
in interfaceLayoutManager2
- Parameters:
-
target
- the target container - Returns:
- the y-axis alignment preference
invalidateLayout
public void invalidateLayout(Container target)
LayoutManager2
- Specified by:
-
invalidateLayout
in interfaceLayoutManager2
- Parameters:
-
target
- the target container
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JRootPane.RootLayout.html