On this page
Interface LayoutManager2
- All Superinterfaces:
-
LayoutManager
- All Known Implementing Classes:
BasicSplitPaneUI.BasicHorizontalLayoutManager
,BasicSplitPaneUI.BasicVerticalLayoutManager
,BorderLayout
,BoxLayout
,CardLayout
,DefaultMenuLayout
,GridBagLayout
,GroupLayout
,JRootPane.RootLayout
,OverlayLayout
,SpringLayout
public interface LayoutManager2 extends LayoutManager
This minimal extension to LayoutManager is intended for tool providers who wish to the creation of constraint-based layouts. It does not yet provide full, general support for custom constraint-based layout managers.
- See Also:
Method Summary
Modifier and Type | Method | Description |
---|---|---|
void |
addLayoutComponent |
Adds the specified component to the layout, using the specified constraint object.
|
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.
|
Dimension |
maximumLayoutSize |
Calculates the maximum size dimensions for the specified container, given the components it contains.
|
Methods declared in interface java.awt.LayoutManager
addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent
Method Details
addLayoutComponent
void addLayoutComponent(Component comp, Object constraints)
- Parameters:
comp
- the component to be addedconstraints
- where/how the component is added to the layout.
maximumLayoutSize
Dimension maximumLayoutSize(Container target)
- Parameters:
target
- the target container- Returns:
- the maximum size of the container
- See Also:
getLayoutAlignmentX
float getLayoutAlignmentX(Container target)
- Parameters:
target
- the target container- Returns:
- the x-axis alignment preference
getLayoutAlignmentY
float getLayoutAlignmentY(Container target)
- Parameters:
target
- the target container- Returns:
- the y-axis alignment preference
invalidateLayout
void invalidateLayout(Container target)
- 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/java/awt/LayoutManager2.html