- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JScrollBar
-
- javax.swing.JScrollPane.ScrollBar
-
- All Implemented Interfaces:
-
Adjustable
,ImageObserver
,MenuContainer
,Serializable
,Accessible
,UIResource
- Enclosing class:
- JScrollPane
protected class JScrollPane.ScrollBar extends JScrollBar implements UIResource
默认情况下,JScrollPane
创建作为此类的实例的滚动条。Scrollbar
覆盖getUnitIncrement
和getBlockIncrement
方法,以便如果视口的视图为Scrollable
,则会要求该视图计算这些值。 除非明确设置单位/块增量。警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4版本开始,所有JavaBeans的长期存储支持已被添加到
java.beans
包中。 请参阅XMLEncoder
。
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class javax.swing.JScrollBar
JScrollBar.AccessibleJScrollBar
-
-
Field Summary
-
Fields inherited from interface java.awt.Adjustable
HORIZONTAL, NO_ORIENTATION, VERTICAL
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class javax.swing.JScrollBar
blockIncrement, model, orientation, unitIncrement
-
-
构造方法摘要
构造方法 Constructor 描述 ScrollBar(int orientation)
用指定的方向创建一个滚动条。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 int
getBlockIncrement(int direction)
如果视口视图为Scrollable
对象,则计算滚动块的增量。int
getUnitIncrement(int direction)
如果视口的视图为Scrollable
对象,则计算滚动的单位增量。void
setBlockIncrement(int blockIncrement)
消息超级设置值,并将blockIncrementSet
实例变量重置为true。void
setUnitIncrement(int unitIncrement)
消息超级设置值,并将unitIncrementSet
实例变量重置为true。-
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, 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
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, 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, 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, isValidateRoot, paint, paintBorder, paintChildren, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class javax.swing.JScrollBar
addAdjustmentListener, fireAdjustmentValueChanged, getAccessibleContext, getAdjustmentListeners, getBlockIncrement, getMaximum, getMaximumSize, getMinimum, getMinimumSize, getModel, getOrientation, getUI, getUIClassID, getUnitIncrement, getValue, getValueIsAdjusting, getVisibleAmount, paramString, removeAdjustmentListener, setEnabled, setMaximum, setMinimum, setModel, setOrientation, setUI, setValue, setValueIsAdjusting, setValues, setVisibleAmount, updateUI
-
-
-
-
方法详细信息
-
setUnitIncrement
public void setUnitIncrement(int unitIncrement)
消息超级设置值,并将unitIncrementSet
实例变量重置为true。- Specified by:
-
setUnitIncrement
在接口Adjustable
- 重写:
-
setUnitIncrement
在JScrollBar
- 参数
-
unitIncrement
- 新的单位增量值,以像素为单位 - 另请参见:
-
JScrollBar.getUnitIncrement(int)
-
getUnitIncrement
public int getUnitIncrement(int direction)
如果视口的视图是Scrollable
对象,则计算滚动的单位增量。 否则返回super.getUnitIncrement
。- 重写:
-
getUnitIncrement
在JScrollBar
- 参数
-
direction
- 向上/向左滚动小于0,向下/向右大于零 - 结果
- 一个整数,以像素为单位,包含单位增量
- 另请参见:
-
Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)
-
setBlockIncrement
public void setBlockIncrement(int blockIncrement)
消息超级设置值,并将blockIncrementSet
实例变量重置为true。- Specified by:
-
setBlockIncrement
在接口Adjustable
- 重写:
-
setBlockIncrement
在JScrollBar
- 参数
-
blockIncrement
- 新的块增量值,以像素为单位 - 另请参见:
-
JScrollBar.getBlockIncrement()
-
getBlockIncrement
public int getBlockIncrement(int direction)
如果视口的视图为Scrollable
对象,则计算滚动块的增量。 否则,blockIncrement
等于视口的宽度或高度。 如果没有视口返回super.getBlockIncrement
。- 重写:
-
getBlockIncrement
JScrollBar
- 参数
-
direction
- 向上/向左滚动小于0,向下/向右大于零 - 结果
- 一个整数,以像素为单位,包含块增量
- 另请参见:
-
Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)
-
-