Java Reference
In-Depth Information
Figure 11-5. Examples of JSplitPane containers
Creating a JSplitPane
There are five constructors for JSplitPane . With them, you can initialize the orientation of the
contained component pair, set the continuousLayout property, or initialize the pair of components
for the container.
public JSplitPane()
JSplitPane splitPane = new JSplitPane();
public JSplitPane(int newOrientation)
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
public JSplitPane(int newOrientation, boolean newContinuousLayout)
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
public JSplitPane(int newOrientation, Component newLeftComponent,
Component newRightComponent)
JComponent topComponent = new JButton("Top Button");
JComponent bottomComponent = new JButton("Bottom Button");
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
topComponent, bottomComponent);
 
Search WWH ::




Custom Search