JLayeredPane
, JDesktopPane
additionally has an instance of DesktopManager
which provides window management for internal frames (allowing you to develop multi-document applications).
JLayeredPane
and JDesktopPane
have a null
layout manager, this means, child components are not arranged in a layout but each component is displayed within its own bounds (a Rectangle
object specifying the components location and display size).
null
-layouts can be difficult but RADi provides some mechanisms to ease this task:
![]() |
A component or container added to JLayeredPane or JDesktopPane is guaranteed to be displayed at least at its preferred size. |
![]() |
You cannot move components outside their parent container. |
![]() |
You can add a content panel to a JLayeredPane or JDesktopPane .The content panel is an ordinary RADi grid which will always be of exactly the same size as its parent container and will be displayed behind all other components. (The content panel, by default, is non-opaque, has a 3x3 grid and all cells have a column weight and a row weight of 1.) Using a content panel combines the best of both worlds: moveable and overlapping components and a reliable and resizable grid. |
![]() |
By adding a Mover to any container, the container can be moved inside the layered pane and has additional docking capabilities (see Mover). |
null
-layout containers, start by dragging a JLayeredPane
or JDesktopPane
to the design grid.preferredSize
property is set to Dimension(240,180)
by default. Because the container doesn't have a LayoutManager
, setting its preferredSize
property is essential.
null
-layout, drag it to the JLayeredPane
or JDesktopPane
. The component's location will be the location where the mouse button was released and the component's size will be its preferred size.
null
-layout, the components' location will be at (10/10, 20/20, ...)
Tip: You can set a component's location and size numerically from the . |
JLayeredPane
or JDesktopPane
, select 'Add Content Panel' from the container's
.