JPanel
, FolderPanel
, JDesktopPane
or JLayeredPane
). You find the appropriate commands in the grid
.JPanel
or FolderPanel
, the selection is replaced by a panel containing the selection (with JPanel
you will see no difference). In case of JDesktopPane
or JLayeredPane
, the selection is added as the pane's content panel and is then replaced by the pane.
![]() | To return to the top hierarchy level, select 'Grid | To Top Container'. |
![]() | To step up one hierarchy level, select 'Grid | To Parent Container'. |
![]() | To switch back to the last displayed container, select 'Grid | To Last Displayed Container'. |
JSplitPane
can hold only two components. The first component you add is added as the top/left component, the second at bottom/right position. If you try to add one more component, a dialog appears, where you can decide to add this component as the splitpane's top/left or bottom/right component (or not at all).
The 'Switch Components' command from the splitpane's
switches both components.
JScrollPane
requires some special care to work as expected.Scrollable
, from its preferredScrollableViewportSize
.
Scrollable
), has a preferred size equal to the image size. This means that, without any additional constraints, the scrollpane would always show the entire image (and therefore wouldn't be very useful). So you should set the preferredSize
property of JScrollPane
to a value smaller than the image size.Scrollable
and has a visibleRowCount
property from which JList
calculates its preferred height (whereas its preferred width is the width of the widest item in the list). As a consequence, JLists
in scrollpanes work perfectly without any additional settings.
Scrollable
and has a visibleRowCount
property (which defaults to 20 visible rows). Its preferred width is equal to the width of the widest tree node, but might easily enlarge as you expand nodes. Therefore, for JTree
, set the visibleRowCount
property to a value which suits your needs, make its grid cell wide enough that nodes will have some place to expand and set the left and right anchors.
Scrollable
and, as the only Swing component, has a preferredScrollableViewportSize
property (which defaults to Dimension(450,400)
). The preferable way to define the scrollpane's size is via the table's preferredScrollableViewportSize
property. (Note: The table header is not included in preferredScrollableViewportSize
.)
Note: With RADi, every JPanel implements Scrollable , the scrolling behaviour is defined by a ScrollableDefinition which you access via the scrollableDefinition property of RadiPanel (see The Scrollable definition).
|