- 所有已实现的接口:
ImageObserver,MenuContainer,Serializable,Accessible
JSplitPane 用于划分两个(并且只有两个)Component s。两个 Component 基于外观实现以图形方式划分,然后用户可以交互式地调整两个 Component 的大小。有关使用 JSplitPane 的信息在 The Java Tutorial 的 如何使用拆分窗格 中。
拆分窗格中的两个 Component 可以使用 JSplitPane.HORIZONTAL_SPLIT 从左到右对齐,或者使用 JSplitPane.VERTICAL_SPLIT 从上到下对齐。更改 Component 大小的首选方法是调用 setDividerLocation,其中 location 是新的 x 或 y 位置,具体取决于 JSplitPane 的方向。
要将 Component 调整为首选大小,请调用 resetToPreferredSizes。
当用户调整 Component 的大小时,Components 的最小尺寸用于确定 Component 可以设置的最大/最小位置。如果两个组件的最小尺寸大于拆分窗格的尺寸,则分隔线将不允许您调整它的大小。要更改 JComponent 的最小大小,请参阅 JComponent.setMinimumSize(java.awt.Dimension) 。
当用户调整拆分窗格大小时,新空间会根据 resizeWeight 属性在两个组件之间分配。默认值 0 表示右/底部组件获得所有空间,而值 1 表示左/顶部组件获得所有空间。
Warning: Swing 不是线程安全的。有关详细信息,请参阅 Swing 的线程策略。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
- 自从:
- 1.2
- 参见:
-
内部类总结
内部类在类 javax.swing.JComponent 中声明的嵌套类/接口
JComponent.AccessibleJComponent在类 java.awt.Container 中声明的嵌套类/接口
Container.AccessibleAWTContainer -
字段摘要
字段修饰符和类型Field描述static final String用于在另一个Component下面添加一个Component。static final StringcontinuousLayout 的绑定属性名称。protected boolean调整大小时是否不断重新显示视图。static final String用于添加代表分频器的Component。static final StringdividerLocation 的绑定属性。static final String边框的绑定属性名称。protected int分隔线的大小。static final int水平分割表示Component沿 x 轴分割。static final StringlastLocation 的绑定属性。protected int拆分窗格的先前位置。static final String用于将一个Component添加到另一个Component的左侧。protected Component左侧或顶部组件。static final StringoneTouchExpandable 的绑定属性。protected boolean是否提供了一个小部件来快速展开/折叠拆分窗格?protected int意见如何分裂。static final String方向(水平或垂直)的绑定属性名称。static final String重量的绑定属性。static final String用于将一个Component添加到另一个Component的右侧。protected Component右侧或底部组件。static final String用于在另一个Component之上添加一个Component。static final int垂直分割表示Component沿 y 轴分割。在类 javax.swing.JComponent 中声明的字段
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW在类 java.awt.Component 中声明的字段
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT在接口 java.awt.image.ImageObserver 中声明的字段
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
构造方法总结
构造方法构造方法描述创建一个新的JSplitPane配置为水平并排排列子组件,使用组件的两个按钮。JSplitPane(int newOrientation) 创建一个配置有指定方向的新JSplitPane。JSplitPane(int newOrientation, boolean newContinuousLayout) 创建具有指定方向和重绘样式的新JSplitPane。JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent) 创建具有指定方向和重绘样式以及指定组件的新JSplitPane。JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent) 创建具有指定方向和指定组件的新JSplitPane。 -
方法总结
修饰符和类型方法描述protected void将指定的组件添加到此拆分窗格。获取与此 JSplitPane 关联的 AccessibleContext。返回下方或分隔符右侧的组件。int返回传递给setDividerLocation的最后一个值。int返回分隔符的大小。int返回分隔线所在的最后位置。返回分隔符左侧(或上方)的组件。int从外观实现中返回分隔线的最大位置。int从外观实现中返回分隔线的最小位置。int返回方向。double返回确定额外空间分配方式的数字。返回分隔符右侧(或下方)的组件。返回上方或分隔符左侧的组件。getUI()返回提供当前外观的SplitPaneUI。返回呈现此组件的 L&F 类的名称。boolean获取continuousLayout属性。boolean获取oneTouchExpandable属性。boolean返回 true,因此在此JSplitPane的任何后代上调用revalidate将导致请求排队,该请求将验证JSplitPane及其所有后代。protected void在向 super 发送消息后,子类化为使用finishedPaintingChildren向 UI 发送消息,以及绘制边框。protected String返回此JSplitPane的字符串表示形式voidremove(int index) 删除指定索引处的Component。void从窗格中删除子组件component。void从拆分窗格中删除所有子组件。void根据子组件的首选大小布置JSplitPane布局。voidsetBottomComponent(Component comp) 将组件设置在分隔线下方或右侧。voidsetContinuousLayout(boolean newContinuousLayout) 设置continuousLayout属性的值,该属性必须为true,以便在用户干预期间不断重新显示和布局子组件。voidsetDividerLocation(double proportionalLocation) 将分隔符位置设置为JSplitPane大小的百分比。voidsetDividerLocation(int location) 设置分隔线的位置。voidsetDividerSize(int newSize) 设置分隔线的大小。voidsetLastDividerLocation(int newLastLocation) 将分隔线所在的最后位置设置为newLastLocation。voidsetLeftComponent(Component comp) 将组件设置到分隔线的左侧(或上方)。voidsetOneTouchExpandable(boolean newValue) 设置oneTouchExpandable属性的值,对于JSplitPane必须是true才能在分隔线上提供 UI 小部件以快速展开/折叠分隔线。voidsetOrientation(int orientation) 设置方向,或拆分器的划分方式。voidsetResizeWeight(double value) 指定当拆分窗格的大小发生变化时如何分配额外空间。voidsetRightComponent(Component comp) 将组件设置到分隔线的右侧(或下方)。voidsetTopComponent(Component comp) 将组件设置在分隔线上方或左侧。voidsetUI(SplitPaneUI ui) 设置呈现此组件的 L&F 对象。voidupdateUI()来自UIManager的通知,L&F 已更改。在类 javax.swing.JComponent 中声明的方法
addAncestorListener, 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, hide, 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在类 java.awt.Container 中声明的方法
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, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree在类 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, 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, 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
-
字段详细信息
-
VERTICAL_SPLIT
public static final int VERTICAL_SPLIT垂直分割表示Component沿 y 轴分割。例如,两个Component将被拆分为一个放在另一个之上。- 参见:
-
HORIZONTAL_SPLIT
public static final int HORIZONTAL_SPLIT水平分割表示Component沿 x 轴分割。例如,两个Component将被拆分到另一个的左侧。- 参见:
-
LEFT
用于将一个Component添加到另一个Component的左侧。- 参见:
-
RIGHT
用于将一个Component添加到另一个Component的右侧。- 参见:
-
TOP
用于在另一个Component之上添加一个Component。- 参见:
-
BOTTOM
用于在另一个Component下面添加一个Component。- 参见:
-
DIVIDER
用于添加代表分频器的Component。- 参见:
-
ORIENTATION_PROPERTY
方向(水平或垂直)的绑定属性名称。- 参见:
-
CONTINUOUS_LAYOUT_PROPERTY
continuousLayout 的绑定属性名称。- 参见:
-
DIVIDER_SIZE_PROPERTY
边框的绑定属性名称。- 参见:
-
ONE_TOUCH_EXPANDABLE_PROPERTY
oneTouchExpandable 的绑定属性。- 参见:
-
LAST_DIVIDER_LOCATION_PROPERTY
lastLocation 的绑定属性。- 参见:
-
DIVIDER_LOCATION_PROPERTY
dividerLocation 的绑定属性。- 自从:
- 1.3
- 参见:
-
RESIZE_WEIGHT_PROPERTY
重量的绑定属性。- 自从:
- 1.3
- 参见:
-
orientation
protected int orientation意见如何分裂。 -
continuousLayout
protected boolean continuousLayout调整大小时是否不断重新显示视图。 -
leftComponent
左侧或顶部组件。 -
rightComponent
右侧或底部组件。 -
dividerSize
protected int dividerSize分隔线的大小。 -
oneTouchExpandable
protected boolean oneTouchExpandable是否提供了一个小部件来快速展开/折叠拆分窗格? -
lastDividerLocation
protected int lastDividerLocation拆分窗格的先前位置。
-
-
构造方法详细信息
-
JSplitPane
public JSplitPane()创建一个新的JSplitPane配置为水平并排排列子组件,使用组件的两个按钮。 -
JSplitPane
创建一个配置有指定方向的新JSplitPane。- 参数:
newOrientation-JSplitPane.HORIZONTAL_SPLIT或JSplitPane.VERTICAL_SPLIT- 抛出:
IllegalArgumentException- 如果orientation不是 HORIZONTAL_SPLIT 或 VERTICAL_SPLIT 之一。
-
JSplitPane
public JSplitPane(int newOrientation, boolean newContinuousLayout) 创建具有指定方向和重绘样式的新JSplitPane。- 参数:
newOrientation-JSplitPane.HORIZONTAL_SPLIT或JSplitPane.VERTICAL_SPLITnewContinuousLayout- 一个boolean,true 表示组件随着分隔线改变位置而连续重绘,false 表示等待分隔线位置停止改变才重绘- 抛出:
IllegalArgumentException- 如果orientation不是 HORIZONTAL_SPLIT 或 VERTICAL_SPLIT 之一
-
JSplitPane
创建具有指定方向和指定组件的新JSplitPane。- 参数:
newOrientation-JSplitPane.HORIZONTAL_SPLIT或JSplitPane.VERTICAL_SPLITnewLeftComponent- 将出现在水平拆分窗格左侧或垂直拆分窗格顶部的ComponentnewRightComponent- 将出现在水平拆分窗格右侧或垂直拆分窗格底部的Component- 抛出:
IllegalArgumentException- 如果orientation不是以下之一:HORIZONTAL_SPLIT 或 VERTICAL_SPLIT
-
JSplitPane
public JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent) 创建具有指定方向和重绘样式以及指定组件的新JSplitPane。- 参数:
newOrientation-JSplitPane.HORIZONTAL_SPLIT或JSplitPane.VERTICAL_SPLITnewContinuousLayout- 一个boolean,true 表示组件随着分隔线改变位置而连续重绘,false 表示等待分隔线位置停止改变才重绘newLeftComponent- 将出现在水平拆分窗格左侧或垂直拆分窗格顶部的ComponentnewRightComponent- 将出现在水平拆分窗格右侧或垂直拆分窗格底部的Component- 抛出:
IllegalArgumentException- 如果orientation不是 HORIZONTAL_SPLIT 或 VERTICAL_SPLIT 之一
-
-
方法详情
-
setUI
设置呈现此组件的 L&F 对象。- 参数:
ui-SplitPaneUIL&F 对象- 参见:
-
getUI
@BeanProperty (bound =false, expert =true, description ="The L&F object that renders this component.") public SplitPaneUI getUI()返回提供当前外观的SplitPaneUI。- 重写:
getUI在类JComponent中- 返回:
-
呈现此组件的
SplitPaneUI对象
-
updateUI
public void updateUI()来自UIManager的通知,L&F 已更改。用UIManager的最新版本替换当前 UI 对象。- 重写:
updateUI在类JComponent中- 参见:
-
getUIClassID
@BeanProperty (bound =false, expert =true, description ="A string that specifies the name of the L&F class.") public String getUIClassID()返回呈现此组件的 L&F 类的名称。- 重写:
getUIClassID在类JComponent中- 返回:
- 字符串“SplitPaneUI”
- 参见:
-
setDividerSize
设置分隔线的大小。分隔符大小newSize < 0将被忽略。- 参数:
newSize- 一个整数,以像素为单位给出分隔符的大小
-
getDividerSize
public int getDividerSize()返回分隔符的大小。- 返回:
- 一个整数,以像素为单位给出分隔线的大小
-
setLeftComponent
将组件设置到分隔线的左侧(或上方)。- 参数:
comp- 在该位置显示的Component
-
getLeftComponent
@BeanProperty (bound =false, preferred =true, description ="The component to the left (or above) the divider.") public Component getLeftComponent()返回分隔符左侧(或上方)的组件。- 返回:
Component显示在该位置
-
setTopComponent
@BeanProperty (bound =false, description ="The component above, or to the left of the divider.") public void setTopComponent(Component comp) 将组件设置在分隔线上方或左侧。- 参数:
comp- 在该位置显示的Component
-
getTopComponent
返回上方或分隔符左侧的组件。- 返回:
Component显示在该位置
-
setRightComponent
@BeanProperty (bound =false, preferred =true, description ="The component to the right (or below) the divider.") public void setRightComponent(Component comp) 将组件设置到分隔线的右侧(或下方)。- 参数:
comp- 在该位置显示的Component
-
getRightComponent
返回分隔符右侧(或下方)的组件。- 返回:
Component显示在该位置
-
setBottomComponent
@BeanProperty (bound =false, description ="The component below, or to the right of the divider.") public void setBottomComponent(Component comp) 将组件设置在分隔线下方或右侧。- 参数:
comp- 在该位置显示的Component
-
getBottomComponent
返回下方或分隔符右侧的组件。- 返回:
Component显示在该位置
-
setOneTouchExpandable
@BeanProperty (description ="UI widget on the divider to quickly expand/collapse the divider.") public void setOneTouchExpandable(boolean newValue) 设置oneTouchExpandable属性的值,对于JSplitPane必须是true才能在分隔线上提供 UI 小部件以快速展开/折叠分隔线。此属性的默认值为false。有些外观可能不支持一键式扩展;他们将忽略此属性。- 参数:
newValue-true指定拆分窗格应提供折叠/展开小部件- 参见:
-
isOneTouchExpandable
public boolean isOneTouchExpandable()获取oneTouchExpandable属性。- 返回:
oneTouchExpandable属性的值- 参见:
-
setLastDividerLocation
@BeanProperty (description ="The last location the divider was at.") public void setLastDividerLocation(int newLastLocation) 将分隔线所在的最后位置设置为newLastLocation。- 参数:
newLastLocation- 一个整数,以像素为单位指定最后一个分隔符位置,从窗格的左(或上)边缘到分隔符的左(或上)边缘
-
getLastDividerLocation
public int getLastDividerLocation()返回分隔线所在的最后位置。- 返回:
- 一个整数,指定最后一个分隔符位置作为从窗格的左(或上)边缘到分隔符的左(或上)边缘的像素计数
-
setOrientation
@BeanProperty (enumerationValues ={"JSplitPane.HORIZONTAL_SPLIT","JSplitPane.VERTICAL_SPLIT"}, description ="The orientation, or how the splitter is divided.") public void setOrientation(int orientation) 设置方向,或拆分器的划分方式。选项是:- JSplitPane.VERTICAL_SPLIT(组件的上方/下方)
- JSplitPane.HORIZONTAL_SPLIT(组件的左/右方向)
- 参数:
orientation- 指定方向的整数- 抛出:
IllegalArgumentException- 如果方向不是以下之一:HORIZONTAL_SPLIT 或 VERTICAL_SPLIT。
-
getOrientation
public int getOrientation()返回方向。- 返回:
- 给出方向的整数
- 参见:
-
setContinuousLayout
@BeanProperty (description ="Whether the child components are continuously redisplayed and laid out during user intervention.") public void setContinuousLayout(boolean newContinuousLayout) 设置continuousLayout属性的值,该属性必须为true,以便在用户干预期间不断重新显示和布局子组件。此属性的默认值取决于外观。有些外观可能不支持连续布局;他们将忽略此属性。- 参数:
newContinuousLayout-true组件是否应随着分隔线改变位置而不断重绘- 参见:
-
isContinuousLayout
public boolean isContinuousLayout()获取continuousLayout属性。- 返回:
continuousLayout属性的值- 参见:
-
setResizeWeight
@BeanProperty (description ="Specifies how to distribute extra space when the split pane resizes.") public void setResizeWeight(double value) 指定当拆分窗格的大小发生变化时如何分配额外空间。默认值 0 表示右/底部组件获得所有额外空间(左/顶部组件固定),而值 1 指定左/顶部组件获得所有额外空间(右/底部组件固定)。具体来说,左/顶部组件获得 (weight * diff) 额外空间,右/底部组件获得 (1 - weight) * diff 额外空间。- 参数:
value- 如上所述- 抛出:
IllegalArgumentException- 如果value是 < 0 或 > 1- 自从:
- 1.3
-
getResizeWeight
public double getResizeWeight()返回确定额外空间分配方式的数字。- 返回:
- 如何在拆分窗格的大小调整时分配额外空间
- 自从:
- 1.3
-
resetToPreferredSizes
public void resetToPreferredSizes()根据子组件的首选大小布置JSplitPane布局。这可能会导致更改分隔线位置。 -
setDividerLocation
@BeanProperty (description ="The location of the divider.") public void setDividerLocation(double proportionalLocation) 将分隔符位置设置为JSplitPane大小的百分比。此方法是根据
setDividerLocation(int)实现的。此方法会根据当前大小立即更改拆分窗格的大小。如果拆分窗格未正确实现并显示在屏幕上,则此方法将无效(新的分隔符位置将变为(当前大小 * proportionalLocation),即 0)。- 参数:
proportionalLocation- 指定百分比的双精度浮点值,从零(上/左)到 1.0(下/右)- 抛出:
IllegalArgumentException- 如果指定位置 < 0 或 > 1.0
-
setDividerLocation
@BeanProperty (description ="The location of the divider.") public void setDividerLocation(int location) 设置分隔线的位置。这将传递给外观实现,然后通知监听器。小于 0 的值意味着应将分隔符重置为尝试遵守左/顶部组件的首选大小的值。通知听众后,最后的分隔符位置通过setLastDividerLocation更新。- 参数:
location- 指定 UI 特定值(通常是像素数)的 int
-
getDividerLocation
public int getDividerLocation()返回传递给setDividerLocation的最后一个值。此方法返回的值可能与实际分隔符位置不同(如果setDividerLocation传递的值大于当前大小)。- 返回:
- 指定分隔符位置的整数
-
getMinimumDividerLocation
@BeanProperty (bound =false, description ="The minimum location of the divider from the L&F.") public int getMinimumDividerLocation()从外观实现中返回分隔线的最小位置。- 返回:
-
一个整数,指定最小位置的特定于 UI 的值(通常是像素数);或者 -1 如果 UI 是
null
-
getMaximumDividerLocation
从外观实现中返回分隔线的最大位置。- 返回:
-
一个整数,指定最大位置的特定于 UI 的值(通常是像素数);或者 -1 如果 UI 是
null
-
remove
从窗格中删除子组件component。根据需要重置leftComponent或rightComponent实例变量。 -
remove
public void remove(int index) 删除指定索引处的Component。根据需要更新leftComponent和rightComponent实例变量,然后是超级消息。 -
removeAll
public void removeAll()从拆分窗格中删除所有子组件。重置leftComonent和rightComponent实例变量。 -
isValidateRoot
返回 true,因此在此JSplitPane的任何后代上调用revalidate将导致请求排队,该请求将验证JSplitPane及其所有后代。- 重写:
isValidateRoot在类JComponent中- 返回:
- true
- 参见:
-
addImpl
将指定的组件添加到此拆分窗格。如果constraints标识左/上或右/下子组件,并且之前添加了具有该标识符的组件,它将被删除,然后comp将被添加到它的位置。如果constraints不是已知标识符之一,布局管理器可能会抛出IllegalArgumentException。可能的约束对象(字符串)是:
- JSplitPane.TOP
- JSplitPane.LEFT
- JSplitPane.BOTTOM
- JSplitPane.RIGHT
constraints对象是null,则将组件添加到第一个可用位置(如果打开则为左/上,否则为右/下)。- 重写:
addImpl在类Container中- 参数:
comp- 要添加的组件constraints- 一个Object指定此组件的布局约束(位置)index- 一个整数,指定容器列表中的索引。- 抛出:
IllegalArgumentException- 如果constraints对象与现有组件不匹配- 参见:
-
paintChildren
在向 super 发送消息后,子类化为使用finishedPaintingChildren向 UI 发送消息,以及绘制边框。- 重写:
paintChildren在类JComponent中- 参数:
g- 在其中绘制的Graphics上下文- 参见:
-
paramString
返回此JSplitPane的字符串表示形式。此方法仅用于调试目的,返回字符串的内容和格式可能因实现而异。返回的字符串可能为空,但可能不是null。- 重写:
paramString在类JComponent中- 返回:
-
这个
JSplitPane的字符串表示。
-
getAccessibleContext
@BeanProperty (bound =false, expert =true, description ="The AccessibleContext associated with this SplitPane.") public AccessibleContext getAccessibleContext()获取与此 JSplitPane 关联的 AccessibleContext。对于拆分窗格,AccessibleContext 采用 AccessibleJSplitPane 的形式。如有必要,将创建一个新的 AccessibleJSplitPane 实例。- 指定者:
getAccessibleContext在接口Accessible中- 重写:
getAccessibleContext在类Component中- 返回:
- 作为此 JSplitPane 的 AccessibleContext 的 AccessibleJSplitPane
-