JSplitPane
Our help dialog uses
two JSplitPane components, one nested inside the other. The inner JSplitPane, at the
top of the dialog, separates the outline of topics on the left from the text on the
right. You can drag the divider left or right to alter the distribution of space
between the two components. The outer JSplitPane separates the top JSplitPane from
the JdbTable at the bottom of the dialog. You can also drag its divider to show more
or less of the table.
Here's what you should know about working with JSplitPane in the UI Designer:
- You can drop two components on a JSplitPane. By default, one goes on the left
of the divider and one goes on the right. You can change the divider orientation
so one component is over the other instead.
- If you add a third component, one of the first two will be removed.
- When working with Swing or dbSwing, the two components are usually
JScrollPanes or TableScrollPanes. You then drop a visual component into each
scroll pane.
- To swap the locations of the two components or to change their orientation from
left/right to top/bottom, drag either component a little to the left, right, top, or
bottom. Don't drag too far, or you'll move it outside the split pane completely.
If you mean to drag a scroll pane, be sure to select it, not the component inside
it.
- It is best not to set the bottomComponent, leftComponent, rightComponent, and
topComponent properties in the Inspector. Work in the Component Tree and the Designer
instead.
- Set a component's minimumSize and preferredSize properties to control its size
at runtime. This won't be visible in design, but at runtime the top or left component's
preferred size determines the initial position of the split pane's divider. Each component's
minimum size limits how small the divider can make it.
- Don't worry if one of the components is very small in design. If necessary,
use the component tree to select it.
In our dialog the tree's preferredSize determines the position of the vertical
divider. The divider can be moved either left or right, but both the tree and the
editor pane have minimumSize settings that limit how far the divider can be moved.
The inner JSplitPane's preferredSize determines the position of the horizontal divider.
The height portion of the table's minimumSize is zero, so the divider may be moved
down until the table is completely hidden.