- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JSplitPane
 
 
 
 
- 
- All Implemented Interfaces:
- ImageObserver,- MenuContainer,- Serializable,- Accessible
 
 @JavaBean(defaultProperty="UI") public class JSplitPane extends JComponent implements Accessible JSplitPaneis used to divide two (and only two)Components. The twoComponents are graphically divided based on the look and feel implementation, and the twoComponents can then be interactively resized by the user. Information on usingJSplitPaneis in How to Use Split Panes in The Java Tutorial.The two Components in a split pane can be aligned left to right usingJSplitPane.HORIZONTAL_SPLIT, or top to bottom usingJSplitPane.VERTICAL_SPLIT. The preferred way to change the size of theComponents is to invokesetDividerLocationwherelocationis either the new x or y position, depending on the orientation of theJSplitPane.To resize the Components to their preferred sizes invokeresetToPreferredSizes.When the user is resizing the Components the minimum size of theComponentsis used to determine the maximum/minimum position theComponents 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 aJComponent, seeJComponent.setMinimumSize(java.awt.Dimension).When the user resizes the split pane the new space is distributed between the two components based on the resizeWeightproperty. 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: Swing is not thread safe. For more information see Swing's Threading Policy. 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 JavaBeans™ has been added to the java.beanspackage. Please seeXMLEncoder.- Since:
- 1.2
- See Also:
- setDividerLocation(double),- resetToPreferredSizes(), Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classJSplitPane.AccessibleJSplitPaneThis class implements accessibility support for theJSplitPaneclass.- 
Nested classes/interfaces declared in class javax.swing.JComponentJComponent.AccessibleJComponent
 - 
Nested classes/interfaces declared in class java.awt.ContainerContainer.AccessibleAWTContainer
 - 
Nested classes/interfaces declared in class java.awt.ComponentComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StringBOTTOMUsed to add aComponentbelow the otherComponent.static StringCONTINUOUS_LAYOUT_PROPERTYBound property name for continuousLayout.protected booleancontinuousLayoutWhether or not the views are continuously redisplayed while resizing.static StringDIVIDERUsed to add aComponentthat will represent the divider.static StringDIVIDER_LOCATION_PROPERTYBound property for the dividerLocation.static StringDIVIDER_SIZE_PROPERTYBound property name for border.protected intdividerSizeSize of the divider.static intHORIZONTAL_SPLITHorizontal split indicates theComponents are split along the x axis.static StringLAST_DIVIDER_LOCATION_PROPERTYBound property for lastLocation.protected intlastDividerLocationPrevious location of the split pane.static StringLEFTUsed to add aComponentto the left of the otherComponent.protected ComponentleftComponentThe left or top component.static StringONE_TOUCH_EXPANDABLE_PROPERTYBound property for oneTouchExpandable.protected booleanoneTouchExpandableIs a little widget provided to quickly expand/collapse the split pane?protected intorientationHow the views are split.static StringORIENTATION_PROPERTYBound property name for orientation (horizontal or vertical).static StringRESIZE_WEIGHT_PROPERTYBound property for weight.static StringRIGHTUsed to add aComponentto the right of the otherComponent.protected ComponentrightComponentThe right or bottom component.static StringTOPUsed to add aComponentabove the otherComponent.static intVERTICAL_SPLITVertical split indicates theComponents are split along the y axis.- 
Fields declared in class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 - 
Fields declared in class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 - 
Fields declared in interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
- 
 - 
Constructor SummaryConstructors Constructor Description JSplitPane()Creates a newJSplitPaneconfigured to arrange the child components side-by-side horizontally, using two buttons for the components.JSplitPane(int newOrientation)Creates a newJSplitPaneconfigured with the specified orientation.JSplitPane(int newOrientation, boolean newContinuousLayout)Creates a newJSplitPanewith the specified orientation and redrawing style.JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent)Creates a newJSplitPanewith the specified orientation and redrawing style, and with the specified components.JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)Creates a newJSplitPanewith the specified orientation and the specified components.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddImpl(Component comp, Object constraints, int index)Adds the specified component to this split pane.AccessibleContextgetAccessibleContext()Gets the AccessibleContext associated with this JSplitPane.ComponentgetBottomComponent()Returns the component below, or to the right of the divider.intgetDividerLocation()Returns the last value passed tosetDividerLocation.intgetDividerSize()Returns the size of the divider.intgetLastDividerLocation()Returns the last location the divider was at.ComponentgetLeftComponent()Returns the component to the left (or above) the divider.intgetMaximumDividerLocation()Returns the maximum location of the divider from the look and feel implementation.intgetMinimumDividerLocation()Returns the minimum location of the divider from the look and feel implementation.intgetOrientation()Returns the orientation.doublegetResizeWeight()Returns the number that determines how extra space is distributed.ComponentgetRightComponent()Returns the component to the right (or below) the divider.ComponentgetTopComponent()Returns the component above, or to the left of the divider.SplitPaneUIgetUI()Returns theSplitPaneUIthat is providing the current look and feel.StringgetUIClassID()Returns the name of the L&F class that renders this component.booleanisContinuousLayout()Gets thecontinuousLayoutproperty.booleanisOneTouchExpandable()Gets theoneTouchExpandableproperty.booleanisValidateRoot()Returns true, so that calls torevalidateon any descendant of thisJSplitPanewill cause a request to be queued that will validate theJSplitPaneand all its descendants.protected voidpaintChildren(Graphics g)Subclassed to message the UI withfinishedPaintingChildrenafter super has been messaged, as well as painting the border.protected StringparamString()Returns a string representation of thisJSplitPane.voidremove(int index)Removes theComponentat the specified index.voidremove(Component component)Removes the child component,componentfrom the pane.voidremoveAll()Removes all the child components from the split pane.voidresetToPreferredSizes()Lays out theJSplitPanelayout based on the preferred size of the children components.voidsetBottomComponent(Component comp)Sets the component below, or to the right of the divider.voidsetContinuousLayout(boolean newContinuousLayout)Sets the value of thecontinuousLayoutproperty, which must betruefor the child components to be continuously redisplayed and laid out during user intervention.voidsetDividerLocation(double proportionalLocation)Sets the divider location as a percentage of theJSplitPane's size.voidsetDividerLocation(int location)Sets the location of the divider.voidsetDividerSize(int newSize)Sets the size of the divider.voidsetLastDividerLocation(int newLastLocation)Sets the last location the divider was at tonewLastLocation.voidsetLeftComponent(Component comp)Sets the component to the left (or above) the divider.voidsetOneTouchExpandable(boolean newValue)Sets the value of theoneTouchExpandableproperty, which must betruefor theJSplitPaneto provide a UI widget on the divider to quickly expand/collapse the divider.voidsetOrientation(int orientation)Sets the orientation, or how the splitter is divided.voidsetResizeWeight(double value)Specifies how to distribute extra space when the size of the split pane changes.voidsetRightComponent(Component comp)Sets the component to the right (or below) the divider.voidsetTopComponent(Component comp)Sets the component above, or to the left of the divider.voidsetUI(SplitPaneUI ui)Sets the L&F object that renders this component.voidupdateUI()Notification from theUIManagerthat the L&F has changed.- 
Methods declared in class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 - 
Methods declared in class java.awt.Containeradd, 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, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
Methods declared in class java.awt.Componentaction, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Field Detail- 
VERTICAL_SPLITpublic static final int VERTICAL_SPLIT Vertical split indicates theComponents are split along the y axis. For example the twoComponents will be split one on top of the other.- See Also:
- Constant Field Values
 
 - 
HORIZONTAL_SPLITpublic static final int HORIZONTAL_SPLIT Horizontal split indicates theComponents are split along the x axis. For example the twoComponents will be split one to the left of the other.- See Also:
- Constant Field Values
 
 - 
LEFTpublic static final String LEFT Used to add aComponentto the left of the otherComponent.- See Also:
- Constant Field Values
 
 - 
RIGHTpublic static final String RIGHT Used to add aComponentto the right of the otherComponent.- See Also:
- Constant Field Values
 
 - 
TOPpublic static final String TOP Used to add aComponentabove the otherComponent.- See Also:
- Constant Field Values
 
 - 
BOTTOMpublic static final String BOTTOM Used to add aComponentbelow the otherComponent.- See Also:
- Constant Field Values
 
 - 
DIVIDERpublic static final String DIVIDER Used to add aComponentthat will represent the divider.- See Also:
- Constant Field Values
 
 - 
ORIENTATION_PROPERTYpublic static final String ORIENTATION_PROPERTY Bound property name for orientation (horizontal or vertical).- See Also:
- Constant Field Values
 
 - 
CONTINUOUS_LAYOUT_PROPERTYpublic static final String CONTINUOUS_LAYOUT_PROPERTY Bound property name for continuousLayout.- See Also:
- Constant Field Values
 
 - 
DIVIDER_SIZE_PROPERTYpublic static final String DIVIDER_SIZE_PROPERTY Bound property name for border.- See Also:
- Constant Field Values
 
 - 
ONE_TOUCH_EXPANDABLE_PROPERTYpublic static final String ONE_TOUCH_EXPANDABLE_PROPERTY Bound property for oneTouchExpandable.- See Also:
- Constant Field Values
 
 - 
LAST_DIVIDER_LOCATION_PROPERTYpublic static final String LAST_DIVIDER_LOCATION_PROPERTY Bound property for lastLocation.- See Also:
- Constant Field Values
 
 - 
DIVIDER_LOCATION_PROPERTYpublic static final String DIVIDER_LOCATION_PROPERTY Bound property for the dividerLocation.- Since:
- 1.3
- See Also:
- Constant Field Values
 
 - 
RESIZE_WEIGHT_PROPERTYpublic static final String RESIZE_WEIGHT_PROPERTY Bound property for weight.- Since:
- 1.3
- See Also:
- Constant Field Values
 
 - 
orientationprotected int orientation How the views are split.
 - 
continuousLayoutprotected boolean continuousLayout Whether or not the views are continuously redisplayed while resizing.
 - 
leftComponentprotected Component leftComponent The left or top component.
 - 
rightComponentprotected Component rightComponent The right or bottom component.
 - 
dividerSizeprotected int dividerSize Size of the divider.
 - 
oneTouchExpandableprotected boolean oneTouchExpandable Is a little widget provided to quickly expand/collapse the split pane?
 - 
lastDividerLocationprotected int lastDividerLocation Previous location of the split pane.
 
- 
 - 
Constructor Detail- 
JSplitPanepublic JSplitPane() Creates a newJSplitPaneconfigured to arrange the child components side-by-side horizontally, using two buttons for the components.
 - 
JSplitPane@ConstructorProperties("orientation") public JSplitPane(int newOrientation) Creates a newJSplitPaneconfigured with the specified orientation.- Parameters:
- newOrientation-- JSplitPane.HORIZONTAL_SPLITor- JSplitPane.VERTICAL_SPLIT
- Throws:
- IllegalArgumentException- if- orientationis not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT.
 
 - 
JSplitPanepublic JSplitPane(int newOrientation, boolean newContinuousLayout)Creates a newJSplitPanewith the specified orientation and redrawing style.- Parameters:
- newOrientation-- JSplitPane.HORIZONTAL_SPLITor- 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
- Throws:
- IllegalArgumentException- if- orientationis not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT
 
 - 
JSplitPanepublic JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)Creates a newJSplitPanewith the specified orientation and the specified components.- Parameters:
- newOrientation-- JSplitPane.HORIZONTAL_SPLITor- JSplitPane.VERTICAL_SPLIT
- newLeftComponent- the- Componentthat will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane
- newRightComponent- the- Componentthat will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane
- Throws:
- IllegalArgumentException- if- orientationis not one of: HORIZONTAL_SPLIT or VERTICAL_SPLIT
 
 - 
JSplitPanepublic JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent)Creates a newJSplitPanewith the specified orientation and redrawing style, and with the specified components.- Parameters:
- newOrientation-- JSplitPane.HORIZONTAL_SPLITor- 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- Componentthat will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane
- newRightComponent- the- Componentthat will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane
- Throws:
- IllegalArgumentException- if- orientationis not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT
 
 
- 
 - 
Method Detail- 
setUIpublic void setUI(SplitPaneUI ui) Sets the L&F object that renders this component.- Parameters:
- ui- the- SplitPaneUIL&F object
- See Also:
- UIDefaults.getUI(javax.swing.JComponent)
 
 - 
getUI@BeanProperty(bound=false, expert=true, description="The L&F object that renders this component.") public SplitPaneUI getUI() Returns theSplitPaneUIthat is providing the current look and feel.- Overrides:
- getUIin class- JComponent
- Returns:
- the SplitPaneUIobject that renders this component
 
 - 
updateUIpublic void updateUI() Notification from theUIManagerthat the L&F has changed. Replaces the current UI object with the latest version from theUIManager.- Overrides:
- updateUIin class- JComponent
- See Also:
- JComponent.updateUI()
 
 - 
getUIClassID@BeanProperty(bound=false, expert=true, description="A string that specifies the name of the L&F class.") public String getUIClassID() Returns the name of the L&F class that renders this component.- Overrides:
- getUIClassIDin class- JComponent
- Returns:
- the string "SplitPaneUI"
- See Also:
- JComponent.getUIClassID(),- UIDefaults.getUI(javax.swing.JComponent)
 
 - 
setDividerSize@BeanProperty(description="The size of the divider.") public void setDividerSize(int newSize) Sets the size of the divider.- Parameters:
- newSize- an integer giving the size of the divider in pixels
 
 - 
getDividerSizepublic int getDividerSize() Returns the size of the divider.- Returns:
- an integer giving the size of the divider in pixels
 
 - 
setLeftComponentpublic void setLeftComponent(Component comp) Sets the component to the left (or above) the divider.- Parameters:
- comp- the- Componentto display in that position
 
 - 
getLeftComponent@BeanProperty(bound=false, preferred=true, description="The component to the left (or above) the divider.") public Component getLeftComponent() Returns the component to the left (or above) the divider.- Returns:
- the Componentdisplayed in that position
 
 - 
setTopComponent@BeanProperty(bound=false, description="The component above, or to the left of the divider.") public void setTopComponent(Component comp) Sets the component above, or to the left of the divider.- Parameters:
- comp- the- Componentto display in that position
 
 - 
getTopComponentpublic Component getTopComponent() Returns the component above, or to the left of the divider.- Returns:
- the Componentdisplayed in that position
 
 - 
setRightComponent@BeanProperty(bound=false, preferred=true, description="The component to the right (or below) the divider.") public void setRightComponent(Component comp) Sets the component to the right (or below) the divider.- Parameters:
- comp- the- Componentto display in that position
 
 - 
getRightComponentpublic Component getRightComponent() Returns the component to the right (or below) the divider.- Returns:
- the Componentdisplayed in that position
 
 - 
setBottomComponent@BeanProperty(bound=false, description="The component below, or to the right of the divider.") public void setBottomComponent(Component comp) Sets the component below, or to the right of the divider.- Parameters:
- comp- the- Componentto display in that position
 
 - 
getBottomComponentpublic Component getBottomComponent() Returns the component below, or to the right of the divider.- Returns:
- the Componentdisplayed in that position
 
 - 
setOneTouchExpandable@BeanProperty(description="UI widget on the divider to quickly expand/collapse the divider.") public void setOneTouchExpandable(boolean newValue) Sets the value of theoneTouchExpandableproperty, which must betruefor theJSplitPaneto provide a UI widget on the divider to quickly expand/collapse the divider. The default value of this property isfalse. Some look and feels might not support one-touch expanding; they will ignore this property.- Parameters:
- newValue-- trueto specify that the split pane should provide a collapse/expand widget
- See Also:
- isOneTouchExpandable()
 
 - 
isOneTouchExpandablepublic boolean isOneTouchExpandable() Gets theoneTouchExpandableproperty.- Returns:
- the value of the oneTouchExpandableproperty
- See Also:
- setOneTouchExpandable(boolean)
 
 - 
setLastDividerLocation@BeanProperty(description="The last location the divider was at.") public void setLastDividerLocation(int newLastLocation) Sets the last location the divider was at tonewLastLocation.- 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
 
 - 
getLastDividerLocationpublic int getLastDividerLocation() 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@BeanProperty(enumerationValues={"JSplitPane.HORIZONTAL_SPLIT","JSplitPane.VERTICAL_SPLIT"}, description="The orientation, or how the splitter is divided.") public void setOrientation(int orientation) Sets the orientation, or how the splitter is divided. The options are:- JSplitPane.VERTICAL_SPLIT (above/below orientation of components)
- JSplitPane.HORIZONTAL_SPLIT (left/right orientation of components)
 - Parameters:
- orientation- an integer specifying the orientation
- Throws:
- IllegalArgumentException- if orientation is not one of: HORIZONTAL_SPLIT or VERTICAL_SPLIT.
 
 - 
getOrientationpublic int getOrientation() Returns the orientation.- Returns:
- an integer giving the orientation
- See Also:
- setOrientation(int)
 
 - 
setContinuousLayout@BeanProperty(description="Whether the child components are continuously redisplayed and laid out during user intervention.") public void setContinuousLayout(boolean newContinuousLayout) Sets the value of thecontinuousLayoutproperty, which must betruefor the child components to be continuously redisplayed and laid out during user intervention. The default value of this property is look and feel dependent. Some look and feels might not support continuous layout; they will ignore this property.- Parameters:
- newContinuousLayout-- trueif the components should continuously be redrawn as the divider changes position
- See Also:
- isContinuousLayout()
 
 - 
isContinuousLayoutpublic boolean isContinuousLayout() Gets thecontinuousLayoutproperty.- Returns:
- the value of the continuousLayoutproperty
- See Also:
- setContinuousLayout(boolean)
 
 - 
setResizeWeight@BeanProperty(description="Specifies how to distribute extra space when the split pane resizes.") public void setResizeWeight(double value) 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
- Throws:
- IllegalArgumentException- if- valueis < 0 or > 1
- Since:
- 1.3
 
 - 
getResizeWeightpublic double getResizeWeight() 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
 
 - 
resetToPreferredSizespublic void resetToPreferredSizes() Lays out theJSplitPanelayout based on the preferred size of the children components. This will likely result in changing the divider location.
 - 
setDividerLocation@BeanProperty(description="The location of the divider.") public void setDividerLocation(double proportionalLocation) Sets the divider location as a percentage of theJSplitPane'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)
- Throws:
- IllegalArgumentException- if the specified location is < 0 or > 1.0
 
 - 
setDividerLocation@BeanProperty(description="The location of the divider.") public void setDividerLocation(int location) 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, viasetLastDividerLocation.- Parameters:
- location- an int specifying a UI-specific value (typically a pixel count)
 
 - 
getDividerLocationpublic int getDividerLocation() Returns the last value passed tosetDividerLocation. The value returned from this method may differ from the actual divider location (ifsetDividerLocationwas passed a value bigger than the current size).- Returns:
- an integer specifying the location of the divider
 
 - 
getMinimumDividerLocation@BeanProperty(bound=false, description="The minimum location of the divider from the L&F.") public int getMinimumDividerLocation() 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@BeanProperty(bound=false) public int getMaximumDividerLocation() 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
 
 - 
removepublic void remove(Component component) Removes the child component,componentfrom the pane. Resets theleftComponentorrightComponentinstance variable, as necessary.- Overrides:
- removein class- Container
- Parameters:
- component- the- Componentto remove
- See Also:
- Container.add(java.awt.Component),- Container.invalidate(),- Container.validate(),- Container.remove(int)
 
 - 
removepublic void remove(int index) Removes theComponentat the specified index. Updates theleftComponentandrightComponentinstance variables as necessary, and then messages super.- Overrides:
- removein 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),- Container.invalidate(),- Container.validate(),- Container.getComponentCount()
 
 - 
removeAllpublic void removeAll() Removes all the child components from the split pane. Resets theleftComonentandrightComponentinstance variables.- Overrides:
- removeAllin class- Container
- See Also:
- Container.add(java.awt.Component),- Container.remove(int),- Container.invalidate()
 
 - 
isValidateRoot@BeanProperty(hidden=true) public boolean isValidateRoot() Returns true, so that calls torevalidateon any descendant of thisJSplitPanewill cause a request to be queued that will validate theJSplitPaneand all its descendants.- Overrides:
- isValidateRootin class- JComponent
- Returns:
- true
- See Also:
- JComponent.revalidate(),- Container.isValidateRoot()
 
 - 
addImplprotected void addImpl(Component comp, Object constraints, int index) Adds the specified component to this split pane. Ifconstraintsidentifies the left/top or right/bottom child component, and a component with that identifier was previously added, it will be removed and thencompwill be added in its place. Ifconstraintsis not one of the known identifiers the layout manager may throw anIllegalArgumentException.The possible constraints objects (Strings) are: - JSplitPane.TOP
- JSplitPane.LEFT
- JSplitPane.BOTTOM
- JSplitPane.RIGHT
 constraintsobject isnull, the component is added in the first available position (left/top if open, else right/bottom).- Overrides:
- addImplin class- Container
- Parameters:
- comp- the component to add
- constraints- an- Objectspecifying the layout constraints (position) for this component
- index- an integer specifying the index in the container's list.
- Throws:
- IllegalArgumentException- if the- constraintsobject does not match an existing component
- See Also:
- Container.addImpl(Component, Object, int)
 
 - 
paintChildrenprotected void paintChildren(Graphics g) Subclassed to message the UI withfinishedPaintingChildrenafter super has been messaged, as well as painting the border.- Overrides:
- paintChildrenin class- JComponent
- Parameters:
- g- the- Graphicscontext within which to paint
- See Also:
- JComponent.paint(java.awt.Graphics),- Container.paint(java.awt.Graphics)
 
 - 
paramStringprotected String paramString() Returns a string representation of thisJSplitPane. 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 benull.- Overrides:
- paramStringin class- JComponent
- Returns:
- a string representation of this JSplitPane.
 
 - 
getAccessibleContext@BeanProperty(bound=false, expert=true, description="The AccessibleContext associated with this SplitPane.") public AccessibleContext getAccessibleContext() 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:
- getAccessibleContextin interface- Accessible
- Overrides:
- getAccessibleContextin class- Component
- Returns:
- an AccessibleJSplitPane that serves as the AccessibleContext of this JSplitPane
 
 
- 
 
-