|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
javax.swing.JComponent
![]()
![]()
![]()
javax.swing.JSplitPane
, MenuContainer
, Serializable
, Accessible

public class JSplitPane


JSplitPane is used to divide two (and only two)
Components. The two Components
are graphically divided based on the look and feel
implementation, and the two Components can then be
interactively resized by the user.
Information on using JSplitPane is in
How to Use Split Panes in
The Java Tutorial.
The two Components in a split pane can be aligned
left to right using
JSplitPane.HORIZONTAL_SPLIT, or top to bottom using
JSplitPane.VERTICAL_SPLIT.
The preferred way to change the size of the Components
is to invoke
setDividerLocation where location is either
the new x or y position, depending on the orientation of the
JSplitPane.
To resize the Components to their preferred sizes invoke
resetToPreferredSizes.
When the user is resizing the Components the minimum
size of the Components is used to determine the
maximum/minimum position the Components
can be set to. If the minimum size of the two
components is greater than the size of the split pane the divider
will not allow you to resize it. To alter the minimum size of a
JComponent, see JComponent.setMinimumSize(java.awt.Dimension)
.
When the user resizes the split pane the new space is distributed between
the two components based on the resizeWeight property.
A value of 0,
the default, indicates the right/bottom component gets all the space,
where as a value of 1 indicates the left/top component gets all the space.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
setDividerLocation(double)
,
resetToPreferredSizes()
,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
JSplitPane.AccessibleJSplitPane
This class implements accessibility support for the JSplitPane class. |
Nested classes/interfaces inherited from class javax.swing.JComponent ![]() |
|---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary | |
|---|---|
static String |
BOTTOM
Used to add a Component below the other
Component. |
static String |
CONTINUOUS_LAYOUT_PROPERTY
Bound property name for continuousLayout. |
protected boolean |
continuousLayout
Whether or not the views are continuously redisplayed while resizing. |
static String |
DIVIDER
Used to add a Component that will represent the divider. |
static String |
DIVIDER_LOCATION_PROPERTY
Bound property for the dividerLocation. |
static String |
DIVIDER_SIZE_PROPERTY
Bound property name for border. |
protected int |
dividerSize
Size of the divider. |
static int |
HORIZONTAL_SPLIT
Horizontal split indicates the Components are
split along the x axis. |
static String |
LAST_DIVIDER_LOCATION_PROPERTY
Bound property for lastLocation. |
protected int |
lastDividerLocation
Previous location of the split pane. |
static String |
LEFT
Used to add a Component to the left of the other
Component. |
protected Component |
leftComponent
The left or top component. |
static String |
ONE_TOUCH_EXPANDABLE_PROPERTY
Bound property for oneTouchExpandable. |
protected boolean |
oneTouchExpandable
Is a little widget provided to quickly expand/collapse the split pane? |
protected int |
orientation
How the views are split. |
static String |
ORIENTATION_PROPERTY
Bound property name for orientation (horizontal or vertical). |
static String |
RESIZE_WEIGHT_PROPERTY
Bound property for weight. |
static String |
RIGHT
Used to add a Component to the right of the other
Component. |
protected Component |
rightComponent
The right or bottom component. |
static String |
TOP
Used to add a Component above the other
Component. |
static int |
VERTICAL_SPLIT
Vertical split indicates the Components are
split along the y axis. |
Fields inherited from class javax.swing.JComponent ![]() |
|---|
accessibleContext |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
JSplitPane
Creates a new JSplitPane configured to arrange the child
components side-by-side horizontally with no continuous
layout, using two buttons for the components. |
|
JSplitPane
Creates a new JSplitPane configured with the
specified orientation and no continuous layout. |
|
JSplitPane
Creates a new JSplitPane with the specified
orientation and redrawing style. |
|
JSplitPane
Creates a new JSplitPane with the specified
orientation and
redrawing style, and with the specified components. |
|
JSplitPane
Creates a new JSplitPane with the specified
orientation and
with the specified components that do not do continuous
redrawing. |
|
| Method Summary | |
|---|---|
protected void |
addImpl
Adds the specified component to this split pane. |
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this JSplitPane. |
Component |
getBottomComponent
Returns the component below, or to the right of the divider. |
int |
getDividerLocation
Returns the last value passed to setDividerLocation. |
int |
getDividerSize
Returns the size of the divider. |
int |
getLastDividerLocation
Returns the last location the divider was at. |
Component |
getLeftComponent
Returns the component to the left (or above) the divider. |
int |
getMaximumDividerLocation
Returns the maximum location of the divider from the look and feel implementation. |
int |
getMinimumDividerLocation
Returns the minimum location of the divider from the look and feel implementation. |
int |
getOrientation
Returns the orientation. |
double |
getResizeWeight
Returns the number that determines how extra space is distributed. |
Component |
getRightComponent
Returns the component to the right (or below) the divider. |
Component |
getTopComponent
Returns the component above, or to the left of the divider. |
SplitPaneUI |
getUI
Returns the SplitPaneUI that is providing the
current look and feel. |
String |
getUIClassID
Returns the name of the L&F class that renders this component. |
boolean |
isContinuousLayout
Gets the continuousLayout property. |
boolean |
isOneTouchExpandable
Gets the oneTouchExpandable property. |
boolean |
isValidateRoot
Returns true, so that calls to revalidate
on any descendant of this JSplitPane
will cause a request to be queued that
will validate the JSplitPane and all its descendants. |
protected void |
paintChildren
Subclassed to message the UI with finishedPaintingChildren
after super has been messaged, as well as painting the border. |
protected String |
paramString
Returns a string representation of this JSplitPane. |
void |
remove
Removes the child component, component from the
pane. |
void |
remove
Removes the Component at the specified index. |
void |
removeAll
Removes all the child components from the split pane. |
void |
resetToPreferredSizes
Lays out the JSplitPane layout based on the preferred size
of the children components. |
void |
setBottomComponent
Sets the component below, or to the right of the divider. |
void |
setContinuousLayout
Sets the value of the continuousLayout property,
which must be true for the child components
to be continuously
redisplayed and laid out during user intervention. |
void |
setDividerLocation
Sets the divider location as a percentage of the JSplitPane's size. |
void |
setDividerLocation
Sets the location of the divider. |
void |
setDividerSize
Sets the size of the divider. |
void |
setLastDividerLocation
Sets the last location the divider was at to newLastLocation. |
void |
setLeftComponent
Sets the component to the left (or above) the divider. |
void |
setOneTouchExpandable
Sets the value of the oneTouchExpandable property,
which must be true for the
JSplitPane to provide a UI widget
on the divider to quickly expand/collapse the divider. |
void |
setOrientation
Sets the orientation, or how the splitter is divided. |
void |
setResizeWeight
Specifies how to distribute extra space when the size of the split pane changes. |
void |
setRightComponent
Sets the component to the right (or below) the divider. |
void |
setTopComponent
Sets the component above, or to the left of the divider. |
void |
setUI
Sets the L&F object that renders this component. |
void |
updateUI
Notification from the UIManager that the L&F has changed. |
Methods inherited from class javax.swing.JComponent ![]() |
|---|
addAncestorListener |