| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| javax.swing.plaf.basic | Provides user interface objects built according to the
Basic look and feel. | 
| javax.swing.plaf.metal | Provides user interface objects built according to
the Java look and feel (once codenamed Metal),
which is the default look and feel. | 
| javax.swing.plaf.synth | 
      Synth is a skinnable look and feel in which all painting is
      delegated. | 
| Modifier and Type | Interface | Description | 
|---|---|---|
| interface  | LayoutManager2Defines an interface for classes that know how to layout Containers
 based on a layout constraints object. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | BorderLayoutA border layout lays out a container, arranging and resizing
 its components to fit in five regions:
 north, south, east, west, and center. | |
| class  | CardLayoutA  CardLayoutobject is a layout manager for a
 container. | |
| class  | FlowLayoutA flow layout arranges components in a directional flow, much
 like lines of text in a paragraph. | |
| class  | GridBagLayoutThe  GridBagLayoutclass is a flexible layout
 manager that aligns components vertically, horizontally or along their
 baseline without requiring that the components be of the same size. | |
| class  | GridLayoutThe  GridLayoutclass is a layout manager that
 lays out a container's components in a rectangular grid. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| LayoutManager | Container. getLayout()Gets the layout manager for this container. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | ScrollPane. setLayout(LayoutManager mgr)Sets the layout manager for this container. | |
| void | Container. setLayout(LayoutManager mgr)Sets the layout manager for this container. | 
| Constructor | Description | 
|---|---|
| Panel(LayoutManager layout)Creates a new panel with the specified layout manager. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | BoxLayoutA layout manager that allows multiple components to be laid out either
 vertically or horizontally. | |
| class  | GroupLayoutGroupLayoutis aLayoutManagerthat hierarchically
 groups components in order to position them in aContainer. | |
| protected class  | JRootPane.RootLayoutA custom layout manager that is responsible for the layout of
 layeredPane, glassPane, and menuBar. | |
| static class  | JSpinner.DateEditorAn editor for a  JSpinnerwhose model is aSpinnerDateModel. | |
| static class  | JSpinner.DefaultEditorA simple base class for more specialized editors
 that displays a read-only view of the model's current
 value with a  JFormattedTextField. | |
| static class  | JSpinner.ListEditorAn editor for a  JSpinnerwhose model is aSpinnerListModel. | |
| static class  | JSpinner.NumberEditorAn editor for a  JSpinnerwhose model is aSpinnerNumberModel. | |
| class  | OverlayLayoutA layout manager to arrange components over the top
 of each other. | |
| class  | ScrollPaneLayoutThe layout manager used by  JScrollPane. | |
| static class  | ScrollPaneLayout.UIResourceThe UI resource version of  ScrollPaneLayout. | |
| class  | SpringLayoutA  SpringLayoutlays out the children of its associated container
 according to a set of constraints. | |
| class  | ViewportLayoutThe default layout manager for  JViewport. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected LayoutManager | JViewport. createLayoutManager()Subclassers can override this to install a different
 layout manager (or  null) in the constructor. | |
| protected LayoutManager | JRootPane. createRootLayout()Called by the constructor methods to create the default
  layoutManager. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| void | JApplet. setLayout(LayoutManager manager)Sets the  LayoutManager. | |
| void | JLayer. setLayout(LayoutManager mgr)Sets the layout manager for this container. | |
| void | Box. setLayout(LayoutManager l)Throws an AWTError, since a Box can use only a BoxLayout. | |
| void | JWindow. setLayout(LayoutManager manager)Sets the  LayoutManager. | |
| void | JToolBar. setLayout(LayoutManager mgr) | |
| void | JInternalFrame. setLayout(LayoutManager manager)Ensures that, by default, the layout of this component cannot be set. | |
| void | JFrame. setLayout(LayoutManager manager)Sets the  LayoutManager. | |
| void | JScrollPane. setLayout(LayoutManager layout)Sets the layout manager for this  JScrollPane. | |
| void | AbstractButton. setLayout(LayoutManager mgr)Sets the layout manager for this container, refer to
  Container.setLayout(LayoutManager)for a complete description of this method. | |
| void | JDialog. setLayout(LayoutManager manager)Sets the  LayoutManager. | 
| Constructor | Description | 
|---|---|
| JPanel(LayoutManager layout)Create a new buffered JPanel with the specified layout manager | |
| JPanel(LayoutManager layout,
      boolean isDoubleBuffered)Creates a new JPanel with the specified layout manager and buffering
 strategy. | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | BasicComboBoxUI.ComboBoxLayoutManagerThis layout manager handles the 'standard' layout of combo boxes. | |
| class  | BasicInternalFrameTitlePane.TitlePaneLayoutThis class should be treated as a "protected" inner class. | |
| class  | BasicInternalFrameUI.InternalFrameLayout | |
| static class  | BasicOptionPaneUI.ButtonAreaLayoutButtonAreaLayoutbehaves in a similar manner toFlowLayout. | |
| class  | BasicScrollBarUIImplementation of ScrollBarUI for the Basic Look and Feel | |
| protected class  | BasicSplitPaneDivider.DividerLayoutUsed to layout a  BasicSplitPaneDivider. | |
| class  | BasicSplitPaneUI.BasicHorizontalLayoutManagerLayoutManager for JSplitPanes that have an orientation of
 HORIZONTAL_SPLIT. | |
| class  | BasicSplitPaneUI.BasicVerticalLayoutManagerLayoutManager used for JSplitPanes with an orientation of
 VERTICAL_SPLIT. | |
| class  | BasicTabbedPaneUI.TabbedPaneLayoutThis class should be treated as a "protected" inner class. | |
| class  | DefaultMenuLayoutThe default layout manager for Popup menus and menubars. | 
| Modifier and Type | Field | Description | 
|---|---|---|
| protected LayoutManager | BasicInternalFrameUI. internalFrameLayout | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected LayoutManager | BasicSpinnerUI. createLayout()Creates a  LayoutManagerthat manages theeditor,nextButton, andpreviousButtonchildren of the JSpinner. | |
| protected LayoutManager | BasicInternalFrameTitlePane. createLayout() | |
| protected LayoutManager | BasicComboBoxUI. createLayoutManager()Creates a layout manager for managing the components which make up the
 combo box. | |
| protected LayoutManager | BasicOptionPaneUI. createLayoutManager() | |
| protected LayoutManager | BasicTabbedPaneUI. createLayoutManager()Invoked by  installUIto create
 a layout manager object to manage
 theJTabbedPane. | |
| protected LayoutManager | BasicInternalFrameUI. createLayoutManager() | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | MetalComboBoxUI.MetalComboBoxLayoutManagerThis class should be treated as a "protected" inner class. | |
| class  | MetalScrollBarUIImplementation of ScrollBarUI for the Metal Look and Feel | |
| class  | MetalTabbedPaneUI.TabbedPaneLayoutThis class should be treated as a "protected" inner class. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected LayoutManager | MetalInternalFrameTitlePane. createLayout() | |
| protected LayoutManager | MetalTabbedPaneUI. createLayoutManager() | |
| protected LayoutManager | MetalComboBoxUI. createLayoutManager() | 
| Modifier and Type | Class | Description | 
|---|---|---|
| class  | SynthScrollBarUIProvides the Synth L&F UI delegate for
  JScrollBar. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| protected LayoutManager | SynthToolBarUI. createLayout()Creates a  LayoutManagerto use with the toolbar. | |
| protected LayoutManager | SynthSpinnerUI. createLayout()Creates a  LayoutManagerthat manages theeditor,nextButton, andpreviousButtonchildren of the JSpinner. | |
| protected LayoutManager | SynthTabbedPaneUI. createLayoutManager()Invoked by  installUIto create
 a layout manager object to manage
 theJTabbedPane. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.