LayoutManager, LayoutManager2, Serializable
public class OverlayLayout 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 | Description | 
|---|---|
| OverlayLayout | Constructs a layout manager that performs overlay arrangement of the children. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | addLayoutComponent | Adds the specified component to the layout, using the specified constraint object. | 
| void | addLayoutComponent | Adds the specified component to the layout. | 
| float | getLayoutAlignmentX | Returns the alignment along the x axis for the container. | 
| float | getLayoutAlignmentY | Returns the alignment along the y axis for the container. | 
| final Container | getTarget() | Returns the container that uses this layout manager. | 
| void | invalidateLayout | Indicates a child has changed its layout related information, which causes any cached calculations to be flushed. | 
| void | layoutContainer | Called by the AWT when the specified container needs to be laid out. | 
| Dimension | maximumLayoutSize | Returns the maximum dimensions needed to lay out the components contained in the specified target container. | 
| Dimension | minimumLayoutSize | Returns the minimum dimensions needed to lay out the components contained in the specified target container. | 
| Dimension | preferredLayoutSize | Returns the preferred dimensions for this layout given the components in the specified target container. | 
| void | removeLayoutComponent | Removes the specified component from the layout. | 
@ConstructorProperties("target") public OverlayLayout(Container target) target - the container to do layout againstpublic final Container getTarget()
public void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2
target - the containerpublic void addLayoutComponent(String name, Component comp)
addLayoutComponent in interface LayoutManager
name - the name of the componentcomp - the component to be addedpublic void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManager
comp - the component to removepublic void addLayoutComponent(Component comp, Object constraints)
addLayoutComponent in interface LayoutManager2
comp - the component to be addedconstraints - where/how the component is added to the layout.public Dimension preferredLayoutSize(Container target)
preferredLayoutSize in interface LayoutManager
target - the component which needs to be laid outpublic Dimension minimumLayoutSize(Container target)
minimumLayoutSize in interface LayoutManager
target - the component which needs to be laid outpublic Dimension maximumLayoutSize(Container target)
getInset.maximumLayoutSize in interface LayoutManager2
target - the component that needs to be laid outDimension object containing the maximum dimensionspublic float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2
target - the containerpublic float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2
target - the containerpublic void layoutContainer(Container target)
layoutContainer in interface LayoutManager
target - the container to lay outAWTError - if the target isn't the container specified to the constructor
    © 1993, 2023, 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/21/docs/api/java.desktop/javax/swing/OverlayLayout.html