javax.swing
Class JSplitPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JSplitPane
All Implemented Interfaces:
Accessible, java.awt.image.ImageObserver, MenuContainer, Serializable

public class JSplitPane
extends JComponent
implements Accessible

Safe: 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.

For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JSplitPane key assignments.

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 java.beans.XMLEncoder.

Version:
1.69 12/03/01
Author:
Scott Violet
See Also:
setDividerLocation(double), resetToPreferredSizes(), Serialized Form

Field Summary
static String BOTTOM
          Suppressed: Used to add a Component below the other Component.
static String CONTINUOUS_LAYOUT_PROPERTY
          Suppressed: Bound property name for continuousLayout.
protected  boolean continuousLayout
          Whether or not the views are continuously redisplayed while resizing.
static String DIVIDER
          Suppressed: Used to add a Component that will represent the divider.
static String DIVIDER_LOCATION_PROPERTY
          Suppressed: Bound property for the dividerLocation.
static String DIVIDER_SIZE_PROPERTY
          Suppressed: Bound property name for border.
private  int dividerLocation
          Location of the divider, at least the value that was set, the UI may have a different value.
protected  int dividerSize
          Size of the divider.
static int HORIZONTAL_SPLIT
          Enabled: Horizontal split indicates the Components are split along the x axis.
static String LAST_DIVIDER_LOCATION_PROPERTY
          Suppressed: Bound property for lastLocation.
protected  int lastDividerLocation
          Previous location of the split pane.
static String LEFT
          Suppressed: 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
          Suppressed: 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
          Suppressed: Bound property name for orientation (horizontal or vertical).
static String RESIZE_WEIGHT_PROPERTY
          Suppressed: Bound property for weight.
private  double resizeWeight
          How to distribute extra space.
static String RIGHT
          Suppressed: Used to add a Component to the right of the other Component.
protected  Component rightComponent
          The right or bottom component.
static String TOP
          Suppressed: Used to add a Component above the other Component.
private static String uiClassID
           
static int VERTICAL_SPLIT
          Enabled: Vertical split indicates the Components are split along the y axis.
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JSplitPane()
          Enabled: 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(int newOrientation)
          Enabled: Creates a new JSplitPane configured with the specified orientation and no continuous layout.
JSplitPane(int newOrientation, boolean newContinuousLayout)
          Enabled: Creates a new JSplitPane with the specified orientation and redrawing style.
JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent)
          Enabled: Creates a new JSplitPane with the specified orientation and redrawing style, and with the specified components.
JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
          Enabled: Creates a new JSplitPane with the specified orientation and with the specified components that do not do continuous redrawing.
 
Method Summary
protected  void addImpl(Component comp, Object constraints, int index)
          Adds the specified component to this split pane.
 AccessibleContext getAccessibleContext()
          Suppressed: Gets the AccessibleContext associated with this JSplitPane.
 Component getBottomComponent()
          Enabled: Returns the component below, or to the right of the divider.
 int getDividerLocation()
          Enabled: Returns the last value passed to setDividerLocation.
 int getDividerSize()
          Enabled: Returns the size of the divider.
 int getLastDividerLocation()
          Enabled: Returns the last location the divider was at.
 Component getLeftComponent()
          Enabled: Returns the component to the left (or above) the divider.
 int getMaximumDividerLocation()
          Enabled: Returns the maximum location of the divider from the look and feel implementation.
 int getMinimumDividerLocation()
          Enabled: Returns the minimum location of the divider from the look and feel implementation.
 int getOrientation()
          Enabled: Returns the orientation.
 double getResizeWeight()
          Enabled: Returns the number that determines how extra space is distributed.
 Component getRightComponent()
          Enabled: Returns the component to the right (or below) the divider.
 Component getTopComponent()
          Enabled: Returns the component above, or to the left of the divider.
 javax.swing.plaf.SplitPaneUI getUI()
          Suppressed: Returns the SplitPaneUI that is providing the current look and feel.
 String getUIClassID()
          Suppressed: Returns the name of the L&F class that renders this component.
 boolean isContinuousLayout()
          Enabled: Gets the continuousLayout property.
 boolean isOneTouchExpandable()
          Enabled: Gets the oneTouchExpandable property.
 boolean isValidateRoot()
          Enabled: 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(Graphics g)
          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(Component component)
          Enabled: Removes the child component, component from the pane.
 void remove(int index)
          Enabled: Removes the Component at the specified index.
 void removeAll()
          Enabled: Removes all the child components from the split pane.
 void resetToPreferredSizes()
          Enabled: Lays out the JSplitPane layout based on the preferred size of the children components.
 void setBottomComponent(Component comp)
          Enabled: Sets the component below, or to the right of the divider.
 void setContinuousLayout(boolean newContinuousLayout)
          Enabled: 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(double proportionalLocation)
          Enabled: Sets the divider location as a percentage of the JSplitPane's size.
 void setDividerLocation(int location)
          Enabled: Sets the location of the divider.
 void setDividerSize(int newSize)
          Enabled: Sets the size of the divider.
 void setLastDividerLocation(int newLastLocation)
          Enabled: Sets the last location the divider was at to newLastLocation.
 void setLeftComponent(Component comp)
          Enabled: Sets the component to the left (or above) the divider.
 void setOneTouchExpandable(boolean newValue)
          Enabled: 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(int orientation)
          Enabled: Sets the orientation, or how the splitter is divided.
 void setResizeWeight(double value)
          Enabled: Specifies how to distribute extra space when the size of the split pane changes.
 void setRightComponent(Component comp)
          Enabled: Sets the component to the right (or below) the divider.
 void setTopComponent(Component comp)
          Enabled: Sets the component above, or to the left of the divider.
 void setUI(javax.swing.plaf.SplitPaneUI ui)
          Suppressed: Sets the L&F object that renders this component.
 void updateUI()
          Suppressed: Notification from the UIManager that the L&F has changed.
private  void writeObject(ObjectOutputStream s)
          See readObject and writeObject in JComponent for more information about serialization in Swing.
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getManagingFocusBackwardTraversalKeys, getManagingFocusForwardTraversalKeys, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getWriteObjCounter, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, setWriteObjCounter, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, get, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, iterate, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, size, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, 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, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, toString, transferFocus, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uiClassID

private static final String uiClassID
See Also:
getUIClassID(), JComponent.readObject(java.io.ObjectInputStream)

VERTICAL_SPLIT

public static final int VERTICAL_SPLIT
Enabled: Vertical split indicates the Components are split along the y axis. For example the two Components will be split one on top of the other.


HORIZONTAL_SPLIT

public static final int HORIZONTAL_SPLIT
Enabled: Horizontal split indicates the Components are split along the x axis. For example the two Components will be split one to the left of the other.


LEFT

public static final String LEFT
Suppressed: Used to add a Component to the left of the other Component.


RIGHT

public static final String RIGHT
Suppressed: Used to add a Component to the right of the other Component.


TOP

public static final String TOP
Suppressed: Used to add a Component above the other Component.


BOTTOM

public static final String BOTTOM
Suppressed: Used to add a Component below the other Component.


DIVIDER

public static final String DIVIDER
Suppressed: Used to add a Component that will represent the divider.


ORIENTATION_PROPERTY

public static final String ORIENTATION_PROPERTY
Suppressed: Bound property name for orientation (horizontal or vertical).


CONTINUOUS_LAYOUT_PROPERTY

public static final String CONTINUOUS_LAYOUT_PROPERTY
Suppressed: Bound property name for continuousLayout.


DIVIDER_SIZE_PROPERTY

public static final String DIVIDER_SIZE_PROPERTY
Suppressed: Bound property name for border.


ONE_TOUCH_EXPANDABLE_PROPERTY

public static final String ONE_TOUCH_EXPANDABLE_PROPERTY
Suppressed: Bound property for oneTouchExpandable.


LAST_DIVIDER_LOCATION_PROPERTY

public static final String LAST_DIVIDER_LOCATION_PROPERTY
Suppressed: Bound property for lastLocation.


DIVIDER_LOCATION_PROPERTY

public static final String DIVIDER_LOCATION_PROPERTY
Suppressed: Bound property for the dividerLocation.

Since:
1.3

RESIZE_WEIGHT_PROPERTY

public static final String RESIZE_WEIGHT_PROPERTY
Suppressed: Bound property for weight.

Since:
1.3.

orientation

protected int orientation
How the views are split.


continuousLayout

protected boolean continuousLayout
Whether or not the views are continuously redisplayed while resizing.


leftComponent

protected Component leftComponent
The left or top component.


rightComponent

protected Component rightComponent
The right or bottom component.


dividerSize

protected int dividerSize
Size of the divider.


oneTouchExpandable

protected boolean oneTouchExpandable
Is a little widget provided to quickly expand/collapse the split pane?


lastDividerLocation

protected int lastDividerLocation
Previous location of the split pane.


resizeWeight

private double resizeWeight
How to distribute extra space.


dividerLocation

private int dividerLocation
Location of the divider, at least the value that was set, the UI may have a different value.

Constructor Detail

JSplitPane

public JSplitPane()
Enabled: 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

public JSplitPane(int newOrientation)
Enabled: Creates a new JSplitPane configured with the specified orientation and no continuous layout.

Parameters:
newOrientation - JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT

JSplitPane

public JSplitPane(int newOrientation,
                  boolean newContinuousLayout)
Enabled: Creates a new JSplitPane with the specified orientation and redrawing style.

Parameters:
newOrientation - JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT
newContinuousLayout - a boolean, true for the components to redraw continuously as the divider changes position, false to wait until the divider position stops changing to redraw

JSplitPane

public JSplitPane(int newOrientation,
                  Component newLeftComponent,
                  Component newRightComponent)
Enabled: Creates a new JSplitPane with the specified orientation and with the specified components that do not do continuous redrawing.

Parameters:
newOrientation - JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT
newLeftComponent - the Component that will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane
newRightComponent - the Component that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane

JSplitPane

public JSplitPane(int newOrientation,
                  boolean newContinuousLayout,
                  Component newLeftComponent,
                  Component newRightComponent)
Enabled: Creates a new JSplitPane with the specified orientation and redrawing style, and with the specified components.

Parameters:
newOrientation - JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT
newContinuousLayout - a boolean, true for the components to redraw continuously as the divider changes position, false to wait until the divider position stops changing to redraw
newLeftComponent - the Component that will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane
newRightComponent - the Component that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane
Method Detail

setUI

public void setUI(javax.swing.plaf.SplitPaneUI ui)
Suppressed: Sets the L&F object that renders this component.

Parameters:
ui - the SplitPaneUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

getUI

public javax.swing.plaf.SplitPaneUI getUI()
Suppressed: Returns the SplitPaneUI that is providing the current look and feel.

Returns:
the SplitPaneUI object that renders this component

updateUI

public void updateUI()
Suppressed: Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.

Overrides:
updateUI in class JComponent
See Also:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
Suppressed: Returns the name of the L&F class that renders this component.

Overrides:
getUIClassID in class JComponent
Returns:
the string "SplitPaneUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

setDividerSize

public void setDividerSize(int newSize)
Enabled: Sets the size of the divider.

Parameters:
newSize - an integer giving the size of the divider in pixels

getDividerSize

public int getDividerSize()
Enabled: Returns the size of the divider.

Returns:
an integer giving the size of the divider in pixels

setLeftComponent

public void setLeftComponent(Component comp)
Enabled: Sets the component to the left (or above) the divider.

Parameters:
comp - the Component to display in that position

getLeftComponent

public Component getLeftComponent()
Enabled: Returns the component to the left (or above) the divider.

Returns:
the Component displayed in that position

setTopComponent

public void setTopComponent(Component comp)
Enabled: Sets the component above, or to the left of the divider.

Parameters:
comp - the Component to display in that position

getTopComponent

public Component getTopComponent()
Enabled: Returns the component above, or to the left of the divider.

Returns:
the Component displayed in that position

setRightComponent

public void setRightComponent(Component comp)
Enabled: Sets the component to the right (or below) the divider.

Parameters:
comp - the Component to display in that position

getRightComponent

public Component getRightComponent()
Enabled: Returns the component to the right (or below) the divider.

Returns:
the Component displayed in that position

setBottomComponent

public void setBottomComponent(Component comp)
Enabled: Sets the component below, or to the right of the divider.

Parameters:
comp - the Component to display in that position

getBottomComponent

public Component getBottomComponent()
Enabled: Returns the component below, or to the right of the divider.

Returns:
the Component displayed in that position

setOneTouchExpandable

public void setOneTouchExpandable(boolean newValue)
Enabled: 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. The default value of this property is false. Some look and feels might not support one-touch expanding; they will ignore this property.

Parameters:
newValue - true to specify that the split pane should provide a collapse/expand widget
See Also:
isOneTouchExpandable()

isOneTouchExpandable

public boolean isOneTouchExpandable()
Enabled: Gets the oneTouchExpandable property.

Returns:
the value of the oneTouchExpandable property
See Also:
setOneTouchExpandable(boolean)

setLastDividerLocation

public void setLastDividerLocation(int newLastLocation)
Enabled: Sets the last location the divider was at to newLastLocation.

Parameters:
newLastLocation - an integer specifying the last divider location in pixels, from the left (or upper) edge of the pane to the left (or upper) edge of the divider

getLastDividerLocation

public int getLastDividerLocation()
Enabled: Returns the last location the divider was at.

Returns:
an integer specifying the last divider location as a count of pixels from the left (or upper) edge of the pane to the left (or upper) edge of the divider

setOrientation

public void setOrientation(int orientation)
Enabled: Sets the orientation, or how the splitter is divided. The options are:

Parameters:
orientation - an integer specifying the orientation

getOrientation

public int getOrientation()
Enabled: Returns the orientation.

Returns:
an integer giving the orientation
See Also:
setOrientation(int)

setContinuousLayout

public void setContinuousLayout(boolean newContinuousLayout)
Enabled: 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. The default value of this property is false. Some look and feels might not support continuous layout; they will ignore this property.

Parameters:
newContinuousLayout - true if the components should continuously be redrawn as the divider changes position
See Also:
isContinuousLayout()

isContinuousLayout

public boolean isContinuousLayout()
Enabled: Gets the continuousLayout property.

Returns:
the value of the continuousLayout property
See Also:
setContinuousLayout(boolean)

setResizeWeight

public void setResizeWeight(double value)
Enabled: Specifies how to distribute extra space when the size of the split pane changes. A value of 0, the default, indicates the right/bottom component gets all the extra space (the left/top component acts fixed), where as a value of 1 specifies the left/top component gets all the extra space (the right/bottom component acts fixed). Specifically, the left/top component gets (weight * diff) extra space and the right/bottom component gets (1 - weight) * diff extra space.

Parameters:
value - as described above
Since:
1.3

getResizeWeight

public double getResizeWeight()
Enabled: Returns the number that determines how extra space is distributed.

Returns:
how extra space is to be distributed on a resize of the split pane
Since:
1.3

resetToPreferredSizes

public void resetToPreferredSizes()
Enabled: Lays out the JSplitPane layout based on the preferred size of the children components. This will likely result in changing the divider location.


setDividerLocation

public void setDividerLocation(double proportionalLocation)
Enabled: Sets the divider location as a percentage of the JSplitPane's size.

This method is implemented in terms of setDividerLocation(int). This method immediately changes the size of the split pane based on its current size. If the split pane is not correctly realized and on screen, this method will have no effect (new divider location will become (current size * proportionalLocation) which is 0).

Parameters:
proportionalLocation - a double-precision floating point value that specifies a percentage, from zero (top/left) to 1.0 (bottom/right)

setDividerLocation

public void setDividerLocation(int location)
Enabled: Sets the location of the divider. This is passed off to the look and feel implementation, and then listeners are notified. A value less than 0 implies the divider should be reset to a value that attempts to honor the preferred size of the left/top component. After notifying the listeners, the last divider location is updated, via setLastDividerLocation.

Parameters:
location - an int specifying a UI-specific value (typically a pixel count)

getDividerLocation

public int getDividerLocation()
Enabled: Returns the last value passed to setDividerLocation. The value returned from this method may differ from the actual divider location (if setDividerLocation was passed a value bigger than the curent size).

Returns:
an integer specifying the location of the divider

getMinimumDividerLocation

public int getMinimumDividerLocation()
Enabled: Returns the minimum location of the divider from the look and feel implementation.

Returns:
an integer specifying a UI-specific value for the minimum location (typically a pixel count); or -1 if the UI is null

getMaximumDividerLocation

public int getMaximumDividerLocation()
Enabled: Returns the maximum location of the divider from the look and feel implementation.

Returns:
an integer specifying a UI-specific value for the maximum location (typically a pixel count); or -1 if the UI is null

remove

public void remove(Component component)
Enabled: Removes the child component, component from the pane. Resets the leftComponent or rightComponent instance variable, as necessary.

Overrides:
remove in class Container
Parameters:
component - the Component to remove
See Also:
Container.add(java.awt.Component)

remove

public void remove(int index)
Enabled: Removes the Component at the specified index. Updates the leftComponent and rightComponent instance variables as necessary, and then messages super.

Overrides:
remove in class Container
Parameters:
index - an integer specifying the component to remove, where 1 specifies the left/top component and 2 specifies the bottom/right component
See Also:
Container.add(java.awt.Component)

removeAll

public void removeAll()
Enabled: Removes all the child components from the split pane. Resets the leftComonent and rightComponent instance variables.

Overrides:
removeAll in class Container
See Also:
Container.add(java.awt.Component), Container.remove(int)

isValidateRoot

public boolean isValidateRoot()
Enabled: 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.

Overrides:
isValidateRoot in class JComponent
Returns:
true
See Also:
JComponent.revalidate()

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
Adds the specified component to this split pane. If constraints identifies the left/top or right/bottom child component, and a component with that identifier was previously added, it will be removed and then comp will be added in its place. If constraints is not one of the known identifiers the layout manager may throw an IllegalArgumentException.

The possible constraints objects (Strings) are:

If the constraints object is null, the component is added in the first available position (left/top if open, else right/bottom).

Overrides:
addImpl in class Container
Parameters:
comp - the component to add
constraints - an Object specifying the layout constraints (position) for this component
index - an integer specifying the index in the container's list.
See Also:
java.awt.Container#addImpl(Component, Object, int)

paintChildren

protected void paintChildren(Graphics g)
Subclassed to message the UI with finishedPaintingChildren after super has been messaged, as well as painting the border.

Overrides:
paintChildren in class JComponent
Parameters:
g - the Graphics context within which to paint
See Also:
JComponent.paint(java.awt.Graphics), java.awt.Container#paint

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
See readObject and writeObject in JComponent for more information about serialization in Swing.

Parameters:
s - the ObjectOutputStream in which to write
IOException

paramString

protected String paramString()
Returns a string representation of this JSplitPane. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString in class JComponent
Returns:
a string representation of this JSplitPane.

getAccessibleContext

public AccessibleContext getAccessibleContext()
Suppressed: Gets the AccessibleContext associated with this JSplitPane. For split panes, the AccessibleContext takes the form of an AccessibleJSplitPane. A new AccessibleJSplitPane instance is created if necessary.

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
an AccessibleJSplitPane that serves as the AccessibleContext of this JSplitPane


comments?