Procedure
This scenario will test
out the features and behavior of the JSplitPane container.
Setup
Create a new empty Visual Class (extending Object). Drop a JSplitPane without
sizing on the free form
Basic Child Manipulation
Initially the
JSplitPane will have a phony left and right buttons as children, sized so that
each button is its default size, and with a horizontal split.
Resize the JSplitPane
graphically both larger and smaller than its default size.
Verify
the change
in space only affects the right component, and the divider remains in the same
location.
Resize the JSplitPane
to take up 3/4ths of the canvas.
Drop a JTree on the
JSplitPane
Verify
the tree is
placed in the left component space
Verify
the tree
shows up in the Java Beans view, with "left - " prefixing its label.
Drop a JSlider on the
JSplitPane
Verify
the slider
is placed in the right component space
Verify
the slider
shows up in the Java Beans view, with "right - " prefixing its label.
Delete the JTree
component.
Verify
the slider
remains in the right component space
Drop a JTable on the
JSplitPane
Verify
the table is
placed in the left component space, and the slider remains in the right
component space.
Delete the JSlider
Verify
the table
remains in the left component space
Drop a JPanel on the
JSplitPane
Verify
the panel is
placed in the right component space, and the table remains in the left component
space.
Drop a JTree on the
JPanel
Verify
that
sub-components of children components show up on the canvas and beans view
properly.
From the source, move
the setRightComponent statement above the setLeftComponent statement.
Verify
the canvas
does not change.
Comment out one of the
setXXXComponent
lines.
Verify
the child
component is removed from the split pane and added to the free form correctly.
Remove the comment from
the
setXXXComponent
line.
Verify
the child
component is added back to the split pane in the correct position
Click and drag the left
component in the Java Beans view. Drop it under the right component.
Verify
the child
components swap places on the canvas
Verify
the child
components are swapped in the
setXXXComponent
lines in the source
Drop a JFrame on the
canvas and size it.
Drop a JSplitPane in
the center region of the JFrame.
Drop an AWT Label on
the left side of the split pane.
Drop an AWT Scrollbar
on the right side of the split pane.
Verify
the AWT
components show up correctly as children of the JSplitPane
Delete the JFrame (and
all it's children).
Orientation Changes
Select the JSplitPane.
On the Property Sheet
look at the orientation property
Verify
the
orientation property exists, and it has options for HORIZONTAL_SPLIT and
VERTICAL_SPLIT
Change the orientation
property to VERTICAL_SPLIT
Verify
the children
realign vertically on the canvas
Verify
the source
has changed so
setLeftComponent
->
setTopComponent
and
setRightComponent
->
setBottomComponent
Verify
the labels
in the Java Beans view change from left / right to top / bottom
Change the orientation
property to HORIZONTAL_SPLIT
Verify
the children
realign back to horizontal on the canvas
Verify
the source
has changed so
setTopComponent
->
setLeftComponent
and
setBottomComponent
->
setRightComponent
Verify
the labels
in the Java Beans view change from top / bottom to left / right
Sizing / Divider / Appearance
Move the JTree to the
left side of the JSplitPane if it's not there already.
Verify
the divider
location moved to fit the tree's preferred size
Select the tree
component
Add 100 to the
preferred size width in the property sheet
Verify
the divider
location moved to fit the tree's new preferred size
Reset the tree's
preferred size to default by removing the setPreferredSize line from the source
code.
Verify
the divider
location moved back to the original preferred size
Select the JSplitPane
Change the
dividerLocation property to 250
Verify
the divider
location moved to the specified location
Reset the
dividerLocation property to default.
Set the resizeWeight
property to 0.75
Verify
the divider
location moved to 75% of the width.
Resize the JSplitPane.
Verify
the divider
location remained at 75% of the new width.
Set the
oneTouchExpandable property to true

Verify
the one
touch expandable buttons show up on the divider bar
Set the dividerSize
property to 25
Verify
the divider
bar becomes 25 pixels wide