- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JSplitPane
-
- 实现的所有接口
-
ImageObserver,MenuContainer,Serializable,Accessible
@JavaBean(defaultProperty="UI") public class JSplitPane extends JComponent implements Accessible
JSplitPane用于划分两个(仅两个)Components。 两个Component基于外观实现进行图形划分,然后用户可以交互式地调整两个Component的大小。 有关使用JSplitPane信息,请参阅 The Java Tutorial中的How to Use Split Panes 。拆分窗格中的两个
Component可以使用JSplitPane.HORIZONTAL_SPLIT从左到右对齐,或使用JSplitPane.VERTICAL_SPLIT从上到下JSplitPane.VERTICAL_SPLIT。 更改Components大小的首选方法是调用setDividerLocation,其中location是新的x或y位置,具体取决于JSplitPane的方向。要将
Component的大小调整为其首选大小,请调用resetToPreferredSizes。当用户是在调整大小的
ComponentS中的最小大小Components被用来确定最大/最小位置Components时,可以设置为。 如果两个组件的最小大小大于拆分窗格的大小,则分隔符将不允许您调整大小。 要更改JComponent的最小尺寸,请参阅JComponent.setMinimumSize(java.awt.Dimension)。当用户调整拆分窗格的大小时,将根据
resizeWeight属性在两个组件之间分配新空间。 值0(默认值)表示右/底组件获取所有空间,其中值为1表示左/顶部组件获取所有空间。警告: Swing不是线程安全的。 有关更多信息,请参阅Swing's Threading Policy 。
警告:此类的序列化对象与以后的Swing版本不兼容。 当前的序列化支持适用于运行相同版本Swing的应用程序之间的短期存储或RMI。 从1.4开始,
java.beans软件包中添加了对所有JavaBeansjava.beans长期存储的支持。 请参阅XMLEncoder。- 从以下版本开始:
- 1.2
- 另请参见:
-
setDividerLocation(double),resetToPreferredSizes(), Serialized Form
-
-
嵌套类汇总
嵌套类 变量和类型 类 描述 protected classJSplitPane.AccessibleJSplitPane此类实现JSplitPane类的可访问性支持。-
嵌套类/接口声明在类 javax.swing.JComponent
JComponent.AccessibleJComponent
-
嵌套类/接口声明在类 java.awt.Container
Container.AccessibleAWTContainer
-
-
字段汇总
字段 变量和类型 字段 描述 static StringBOTTOM用来添加Component其他下方Component。static StringCONTINUOUS_LAYOUT_PROPERTYcontinuousLayout的绑定属性名称。protected booleancontinuousLayout是否在调整大小时不断重新显示视图。static StringDIVIDER用于添加代表分隔符的Component。static StringDIVIDER_LOCATION_PROPERTYdividerLocation的绑定属性。static StringDIVIDER_SIZE_PROPERTY边界的绑定属性名称。protected intdividerSize分频器的大小。static intHORIZONTAL_SPLIT水平分割表示Component沿x轴分割。static StringLAST_DIVIDER_LOCATION_PROPERTYlastLocation的绑定属性。protected intlastDividerLocation拆分窗格的上一个位置。static StringLEFT用于将添加Component其他左侧Component。protected ComponentleftComponent左侧或顶部组件。static StringONE_TOUCH_EXPANDABLE_PROPERTYoneTouchExpandable的绑定属性。protected booleanoneTouchExpandable是否提供了一个小窗口小部件来快速展开/折叠拆分窗格?protected intorientation视图如何分割。static StringORIENTATION_PROPERTY方向的绑定属性名称(水平或垂直)。static StringRESIZE_WEIGHT_PROPERTY绑定属性的重量。static StringRIGHT用于将添加Component其他权Component。protected ComponentrightComponent右侧或底部组件。static StringTOP用来添加Component上述其它Component。static intVERTICAL_SPLIT垂直分割表示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
-
Fields declared in interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
构造方法摘要
构造方法 构造器 描述 JSplitPane()创建一个新的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 voidaddImpl(Component comp, Object constraints, int index)将指定的组件添加到此拆分窗格。AccessibleContextgetAccessibleContext()获取与此JSplitPane关联的AccessibleContext。ComponentgetBottomComponent()返回分隔符下方或分隔符右侧的组件。intgetDividerLocation()返回传递给setDividerLocation的最后一个值。intgetDividerSize()返回分隔符的大小。intgetLastDividerLocation()返回分隔符所在的最后位置。ComponentgetLeftComponent()返回分隔符左侧(或上方)的组件。intgetMaximumDividerLocation()从外观实现返回分隔符的最大位置。intgetMinimumDividerLocation()从外观实现返回分隔符的最小位置。intgetOrientation()返回方向。doublegetResizeWeight()返回确定如何分配额外空间的数字。ComponentgetRightComponent()返回分隔符右侧(或下方)的组件。ComponentgetTopComponent()返回分隔符上方或左侧的组件。SplitPaneUIgetUI()返回提供当前外观的SplitPaneUI。StringgetUIClassID()返回呈现此组件的L&F类的名称。booleanisContinuousLayout()获取continuousLayout属性。booleanisOneTouchExpandable()获取oneTouchExpandable属性。booleanisValidateRoot()返回true,因此调用revalidate这个的任何后代JSplitPane将导致请求被排队将验证JSplitPane及其所有后代。protected voidpaintChildren(Graphics g)在超级消息finishedPaintingChildren后,子finishedPaintingChildren以finishedPaintingChildren向UIfinishedPaintingChildren消息,以及绘制边框。protected StringparamString()返回此JSplitPane的字符串表示JSplitPane。voidremove(int index)删除指定索引处的Component。voidremove(Component component)从窗格中删除子组件component。voidremoveAll()从拆分窗格中删除所有子组件。voidresetToPreferredSizes()根据子组件的首选大小布置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属性的值,oneTouchExpandable必须为true才能在JSplitPane上提供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, 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, 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
-
-
-
-
字段详细信息
-
VERTICAL_SPLIT
public static final int VERTICAL_SPLIT
垂直分割表示Component沿y轴分割。 例如,两个Component将一个在另一个上面拆分。- 另请参见:
- 常数字段值
-
HORIZONTAL_SPLIT
public static final int HORIZONTAL_SPLIT
水平分割表示Component沿x轴分割。 例如,两个Component将被拆分为另一个的左侧。- 另请参见:
- 常数字段值
-
CONTINUOUS_LAYOUT_PROPERTY
public static final String CONTINUOUS_LAYOUT_PROPERTY
continuousLayout的绑定属性名称。- 另请参见:
- 常数字段值
-
ONE_TOUCH_EXPANDABLE_PROPERTY
public static final String ONE_TOUCH_EXPANDABLE_PROPERTY
oneTouchExpandable的绑定属性。- 另请参见:
- 常数字段值
-
LAST_DIVIDER_LOCATION_PROPERTY
public static final String LAST_DIVIDER_LOCATION_PROPERTY
lastLocation的绑定属性。- 另请参见:
- 常数字段值
-
DIVIDER_LOCATION_PROPERTY
public static final String DIVIDER_LOCATION_PROPERTY
dividerLocation的绑定属性。- 从以下版本开始:
- 1.3
- 另请参见:
- 常数字段值
-
RESIZE_WEIGHT_PROPERTY
public static final String RESIZE_WEIGHT_PROPERTY
绑定属性的重量。- 从以下版本开始:
- 1.3
- 另请参见:
- 常数字段值
-
orientation
protected int orientation
视图如何分割。
-
continuousLayout
protected boolean continuousLayout
是否在调整大小时不断重新显示视图。
-
leftComponent
protected Component leftComponent
左侧或顶部组件。
-
rightComponent
protected Component rightComponent
右侧或底部组件。
-
dividerSize
protected int dividerSize
分频器的大小。
-
oneTouchExpandable
protected boolean oneTouchExpandable
是否提供了一个小窗口小部件来快速展开/折叠拆分窗格?
-
lastDividerLocation
protected int lastDividerLocation
拆分窗格的上一个位置。
-
-
构造方法详细信息
-
JSplitPane
public JSplitPane()
创建一个新的JSplitPane配置为使用组件的两个按钮水平并排排列子组件。
-
JSplitPane
@ConstructorProperties("orientation") public JSplitPane(int newOrientation)
创建使用指定方向配置的新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_SPLIT -
newContinuousLayout- 布尔值,true表示组件在分隔符更改位置时连续重绘,false表示等待,直到分隔符位置停止更改为重绘 - 异常
-
IllegalArgumentException- 如果orientation不是HORIZONTAL_SPLIT或VERTICAL_SPLIT之一
-
JSplitPane
public JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)创建具有指定方向和指定组件的新JSplitPane。- 参数
-
newOrientation-JSplitPane.HORIZONTAL_SPLIT或JSplitPane.VERTICAL_SPLIT -
newLeftComponent- 将显示在水平拆分窗格左侧或垂直拆分窗格顶部的Component -
newRightComponent- 将显示在水平拆分窗格右侧或垂直拆分窗格底部的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_SPLIT -
newContinuousLayout- 布尔值,true表示组件在分隔符更改位置时连续重绘,false表示等待,直到分隔符位置停止更改为重绘 -
newLeftComponent- 将显示在水平拆分窗格左侧或垂直拆分窗格顶部的Component -
newRightComponent- 将显示在水平拆分窗格右侧或垂直拆分窗格底部的Component - 异常
-
IllegalArgumentException- 如果orientation不是HORIZONTAL_SPLIT或VERTICAL_SPLIT之一
-
-
方法详细信息
-
setUI
public void setUI(SplitPaneUI ui)
设置呈现此组件的L&F对象。- 参数
-
ui-SplitPaneUIL&F对象 - 另请参见:
-
UIDefaults.getUI(javax.swing.JComponent)
-
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 - 另请参见:
-
JComponent.updateUI()
-
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”
- 另请参见:
-
JComponent.getUIClassID(),UIDefaults.getUI(javax.swing.JComponent)
-
setDividerSize
@BeanProperty(description="The size of the divider.") public void setDividerSize(int newSize)
设置分隔符的大小。- 参数
-
newSize- 一个整数,给出分隔符的大小(以像素为单位)
-
getDividerSize
public int getDividerSize()
返回分隔符的大小。- 结果
- 一个整数,给出分隔符的大小(以像素为单位)
-
setLeftComponent
public void setLeftComponent(Component comp)
将组件设置为分隔符的左侧(或上方)。- 参数
-
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
public 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
public 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
public Component getBottomComponent()
返回分隔符下方或分隔符右侧的组件。- 结果
-
Component显示在该位置
-
setOneTouchExpandable
@BeanProperty(description="UI widget on the divider to quickly expand/collapse the divider.") public void setOneTouchExpandable(boolean newValue)
设置oneTouchExpandable属性的值,oneTouchExpandable必须为true才能在JSplitPane上提供UI小部件以快速展开/折叠分隔符。 此属性的默认值为false。 一些外观和感觉可能不支持一触式扩展; 他们会忽略这个属性。- 参数
-
newValue-true指定拆分窗格应提供折叠/展开窗口小部件 - 另请参见:
-
isOneTouchExpandable()
-
isOneTouchExpandable
public boolean isOneTouchExpandable()
获取oneTouchExpandable属性。- 结果
-
oneTouchExpandable属性的值 - 另请参见:
-
setOneTouchExpandable(boolean)
-
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- 如果orientation不是以下之一:HORIZONTAL_SPLIT或VERTICAL_SPLIT。
-
getOrientation
public int getOrientation()
返回方向。- 结果
- 给出方向的整数
- 另请参见:
-
setOrientation(int)
-
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()
-
isContinuousLayout
public boolean isContinuousLayout()
获取continuousLayout属性。- 结果
-
continuousLayout属性的值 - 另请参见:
-
setContinuousLayout(boolean)
-
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特定值(通常是像素数);
如果UI是
null则null-1
-
getMaximumDividerLocation
@BeanProperty(bound=false) public int getMaximumDividerLocation()
从外观实现返回分隔符的最大位置。- 结果
-
一个整数,指定最大位置的UI特定值(通常是像素数);
如果UI是
null则null-1
-
remove
public void remove(Component component)
从窗格中删除子组件component。 根据需要重置leftComponent或rightComponent实例变量。- 重写:
-
remove在类Container - 参数
-
component- 要删除的Component - 另请参见:
-
Container.add(java.awt.Component),Container.invalidate(),Container.validate(),Container.remove(int)
-
remove
public void remove(int index)
删除指定索引处的Component。 根据需要更新leftComponent和rightComponent实例变量,然后更新消息。- 重写:
-
remove在类Container - 参数
-
index- 一个整数,指定要删除的组件,其中1指定左/顶部组件,2指定底部/右侧组件 - 另请参见:
-
Container.add(java.awt.Component),Container.invalidate(),Container.validate(),Container.getComponentCount()
-
removeAll
public void removeAll()
从拆分窗格中删除所有子组件。 重置leftComonent和rightComponent实例变量。
-
isValidateRoot
@BeanProperty(hidden=true) public boolean isValidateRoot()
返回true,因此调用revalidate这个的任何后代JSplitPane将导致请求被排队将验证JSplitPane及其所有后代。- 重写:
-
isValidateRoot在类JComponent - 结果
- 真正
- 另请参见:
-
JComponent.revalidate(),Container.isValidateRoot()
-
addImpl
protected void addImpl(Component comp, Object constraints, int index)
将指定的组件添加到此拆分窗格。 如果constraints标识了左/上或右/constraints组件,并且之前添加了具有该标识符的组件,则将其删除,然后将在其位置添加comp。 如果constraints不是已知标识符之一,则布局管理器可以抛出IllegalArgumentException。可能的约束对象(字符串)是:
- JSplitPane.TOP
- JSplitPane.LEFT
- JSplitPane.BOTTOM
- JSplitPane.RIGHT
constraints对象是null,则组件将添加到第一个可用位置(如果打开则为left / top,否则为right / bottom)。- 重写:
-
addImpl在类Container - 参数
-
comp- 要添加的组件 -
constraints- 指定此组件的布局约束(位置)的Object -
index- 一个整数,指定容器列表中的索引。 - 异常
-
IllegalArgumentException- 如果constraints对象与现有组件不匹配 - 另请参见:
-
Container.addImpl(Component, Object, int)
-
paintChildren
protected void paintChildren(Graphics g)
在超级消息finishedPaintingChildren后,子finishedPaintingChildren用finishedPaintingChildren向UIfinishedPaintingChildren消息,以及绘制边框。- 重写:
-
paintChildren在类JComponent - 参数
-
g- 要绘制的Graphics上下文 - 另请参见:
-
JComponent.paint(java.awt.Graphics),Container.paint(java.awt.Graphics)
-
paramString
protected String paramString()
返回此JSplitPane的字符串表示JSplitPane。 此方法仅用于调试目的,返回字符串的内容和格式可能因实现而异。 返回的字符串可能为空,但可能不是null。- 重写:
-
paramString在类JComponent - 结果
-
此
JSplitPane的字符串表示JSplitPane。
-
getAccessibleContext
@BeanProperty(bound=false, expert=true, description="The AccessibleContext associated with this SplitPane.") public AccessibleContext getAccessibleContext()
获取与此JSplitPane关联的AccessibleContext。 对于拆分窗格,AccessibleContext采用AccessibleJSplitPane的形式。 如有必要,将创建一个新的AccessibleJSplitPane实例。- Specified by:
-
getAccessibleContext在界面Accessible - 重写:
-
getAccessibleContext在类Component - 结果
- 一个AccessibleJSplitPane,用作此JSplitPane的AccessibleContext
-
-