javax.swing
public class JSplitPane extends JComponent implements Accessible
Modifier and Type | Class and Description |
---|---|
protected class |
JSplitPane.AccessibleJSplitPane
Provides the accessibility features for the
JSplitPane
component. |
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static String |
BOTTOM
The constraints string used to add components to the bottom.
|
static String |
CONTINUOUS_LAYOUT_PROPERTY
The property fired when the continuousLayout property changes.
|
protected boolean |
continuousLayout
Whether the JSplitPane uses continuous layout.
|
static String |
DIVIDER
The property fired when the divider property changes.
|
static String |
DIVIDER_LOCATION_PROPERTY
The property fired when the divider location property changes.
|
static String |
DIVIDER_SIZE_PROPERTY
The property fired when the divider size property changes.
|
protected int |
dividerSize
The size of the divider.
|
static int |
HORIZONTAL_SPLIT
The value of the orientation when the components are split horizontally.
|
static String |
LAST_DIVIDER_LOCATION_PROPERTY
The property fired when the last divider location property changes.
|
protected int |
lastDividerLocation
The last location of the divider given by the UI.
|
static String |
LEFT
The constraints string used to add components to the left.
|
protected Component |
leftComponent
The component on the top or left.
|
static String |
ONE_TOUCH_EXPANDABLE_PROPERTY
The property fired when the one touch expandable property changes.
|
protected boolean |
oneTouchExpandable
Whether the JSplitPane uses one touch expandable buttons.
|
protected int |
orientation
The orientation of the JSplitPane.
|
static String |
ORIENTATION_PROPERTY
The property fired when the orientation property changes.
|
static String |
RESIZE_WEIGHT_PROPERTY
The property fired when the resize weight property changes.
|
static String |
RIGHT
The constraints string used to add components to the right.
|
protected Component |
rightComponent
The component on the right or bottom.
|
static String |
TOP
The constraints string used to add components to the top.
|
static int |
VERTICAL_SPLIT
The value of the orientation when the components are split vertically.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JSplitPane()
Creates a new JSplitPane object using HORIZONTAL_SPLIT and a
nonContinuousLayout mode.
|
JSplitPane(int newOrientation)
Creates a new JSplitPane object using a nonContinuousLayout mode and the
given orientation.
|
JSplitPane(int newOrientation,
boolean newContinuousLayout)
Creates a new JSplitPane object with the given layout mode and
orientation.
|
JSplitPane(int newOrientation,
boolean newContinuousLayout,
Component newLeftComponent,
Component newRightComponent)
Creates a new JSplitPane object with the given orientation, layout mode,
and left and right components.
|
JSplitPane(int newOrientation,
Component newLeftComponent,
Component newRightComponent)
Creates a new JSplitPane object using nonContinuousLayout mode, the given
orientation and left and right components.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index)
This method adds a component to the JSplitPane.
|
AccessibleContext |
getAccessibleContext()
Returns the object that provides accessibility features for this
JSplitPane component. |
Component |
getBottomComponent()
This method returns the bottom component.
|
int |
getDividerLocation()
This method returns the location of the divider.
|
int |
getDividerSize()
This method returns the size of the divider.
|
int |
getLastDividerLocation()
This method returns the last divider location.
|
Component |
getLeftComponent()
This method returns the left component.
|
int |
getMaximumDividerLocation()
This method returns the maximum divider location.
|
int |
getMinimumDividerLocation()
This method returns the minimum divider location.
|
int |
getOrientation()
This method returns the orientation that the JSplitPane is using.
|
double |
getResizeWeight()
This method returns the current resize weight.
|
Component |
getRightComponent()
This method returns the right component.
|
Component |
getTopComponent()
This method returns the top component.
|
SplitPaneUI |
getUI()
This method returns the UI.
|
String |
getUIClassID()
This method returns a string identifier to determine which UI class it
needs.
|
boolean |
isContinuousLayout()
This method returns true if the JSplitPane is using a continuousLayout.
|
boolean |
isOneTouchExpandable()
This method returns true if the divider has one touch expandable buttons.
|
boolean |
isValidateRoot()
This method returns true.
|
protected void |
paintChildren(Graphics g)
This method overrides JComponent's paintChildren so the UI can be
messaged when the children have finished painting.
|
protected String |
paramString()
Returns an implementation-dependent string describing the attributes of
this
JSplitPane . |
void |
remove(Component component)
This method removes the given component from the JSplitPane.
|
void |
remove(int index)
This method removes the component at the given index.
|
void |
removeAll()
This method removes all components from the JSplitPane.
|
void |
resetToPreferredSizes()
This method resets all children of the JSplitPane to their preferred
sizes.
|
void |
setBottomComponent(Component comp)
This method sets the bottom component.
|
void |
setContinuousLayout(boolean newContinuousLayout)
This method sets the layout mode for the JSplitPane.
|
void |
setDividerLocation(double proportionalLocation)
This method sets the location of the divider.
|
void |
setDividerLocation(int location)
This method sets the location of the divider.
|
void |
setDividerSize(int newSize)
This method sets the size of the divider.
|
void |
setLastDividerLocation(int newLastLocation)
This method sets the last location of the divider.
|
void |
setLeftComponent(Component comp)
This method sets the left component.
|
void |
setOneTouchExpandable(boolean newValue)
This method sets whether the divider has one touch expandable buttons.
|
void |
setOrientation(int orientation)
Sets the orientation for the
JSplitPane and sends a
PropertyChangeEvent (with the property name
ORIENTATION_PROPERTY ) to all registered listeners. |
void |
setResizeWeight(double value)
This method determines how extra space will be distributed among the left
and right components.
|
void |
setRightComponent(Component comp)
This method sets the right component.
|
void |
setTopComponent(Component comp)
This method sets the top component.
|
void |
setUI(SplitPaneUI ui)
This method sets the UI used by the JSplitPane.
|
void |
updateUI()
This method resets the UI to the one specified by the current Look and
Feel.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final String BOTTOM
public static final String CONTINUOUS_LAYOUT_PROPERTY
public static final String DIVIDER
public static final String DIVIDER_LOCATION_PROPERTY
public static final String DIVIDER_SIZE_PROPERTY
public static final int HORIZONTAL_SPLIT
public static final String LAST_DIVIDER_LOCATION_PROPERTY
public static final String LEFT
public static final String ONE_TOUCH_EXPANDABLE_PROPERTY
public static final String ORIENTATION_PROPERTY
public static final String RESIZE_WEIGHT_PROPERTY
public static final String RIGHT
public static final String TOP
public static final int VERTICAL_SPLIT
protected boolean continuousLayout
protected boolean oneTouchExpandable
protected int dividerSize
protected int lastDividerLocation
protected int orientation
protected Component leftComponent
protected Component rightComponent
public JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent)
newOrientation
- The orientation to use.newContinuousLayout
- The layout mode to use.newLeftComponent
- The left component.newRightComponent
- The right component.IllegalArgumentException
- DOCUMENT ME!public JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
newOrientation
- The orientation to use.newLeftComponent
- The left component.newRightComponent
- The right component.public JSplitPane(int newOrientation, boolean newContinuousLayout)
newOrientation
- The orientation to use.newContinuousLayout
- The layout mode to use.public JSplitPane(int newOrientation)
newOrientation
- The orientation to use.public JSplitPane()
protected void addImpl(Component comp, Object constraints, int index)
addImpl
in class Container
comp
- The component to add.constraints
- The constraints string to use.index
- Where to place to component in the list of components.IllegalArgumentException
- When the constraints is not a known
identifier.public AccessibleContext getAccessibleContext()
JSplitPane
component.getAccessibleContext
in interface Accessible
getAccessibleContext
in class JComponent
JSplitPane.AccessibleJSplitPane
).public Component getBottomComponent()
public int getDividerLocation()
public int getDividerSize()
public int getLastDividerLocation()
public Component getLeftComponent()
public int getMaximumDividerLocation()
public int getMinimumDividerLocation()
public int getOrientation()
public double getResizeWeight()
public Component getRightComponent()
public Component getTopComponent()
public SplitPaneUI getUI()
public boolean isContinuousLayout()
public boolean isOneTouchExpandable()
public boolean isValidateRoot()
isValidateRoot
in class JComponent
protected void paintChildren(Graphics g)
paintChildren
in class JComponent
g
- The Graphics object to paint with.JComponent.paint(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintComponent(java.awt.Graphics)
protected String paramString()
JSplitPane
.paramString
in class JComponent
JSplitPane
(never null
).public void remove(Component component)
public void remove(int index)
public void removeAll()
public void resetToPreferredSizes()
public void setBottomComponent(Component comp)
comp
- The Component to be placed at the bottom.public void setContinuousLayout(boolean newContinuousLayout)
newContinuousLayout
- Whether the JSplitPane is in continuousLayout
mode.public void setDividerLocation(double proportionalLocation)
proportionalLocation
- A double that describes the location of the
divider.IllegalArgumentException
- if proportionalLocation
is
not in the range from 0.0 to 1.0 inclusive.public void setDividerLocation(int location)
location
- The location of the divider. The negative value forces to
compute the new location from the preferred sizes of the split
pane components.public void setDividerSize(int newSize)
newSize
- The size of the divider.public void setLastDividerLocation(int newLastLocation)
newLastLocation
- The last location of the divider.public void setLeftComponent(Component comp)
comp
- The left component.public void setOneTouchExpandable(boolean newValue)
newValue
- Whether the divider will have one touch expandable
buttons.public void setOrientation(int orientation)
JSplitPane
and sends a
PropertyChangeEvent
(with the property name
ORIENTATION_PROPERTY
) to all registered listeners.orientation
- the orientation (either HORIZONTAL_SPLIT
or VERTICAL_SPLIT
).IllegalArgumentException
- if orientation
is not one of
the listed values.public void setResizeWeight(double value)
value
- The resize weight.public void setRightComponent(Component comp)
comp
- The right component.public void setTopComponent(Component comp)
comp
- The top component.public void setUI(SplitPaneUI ui)
ui
- The UI to use.public void updateUI()
updateUI
in class JComponent
public String getUIClassID()
getUIClassID
in class JComponent
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()