JavaTM 2 Platform
Standard Ed. 6

javax.swing
類別 JScrollPane.ScrollBar

java.lang.Object
  繼承者 java.awt.Component
      繼承者 java.awt.Container
          繼承者 javax.swing.JComponent
              繼承者 javax.swing.JScrollBar
                  繼承者 javax.swing.JScrollPane.ScrollBar
所有已實作的介面:
Adjustable, ImageObserver, MenuContainer, Serializable, Accessible, UIResource
正在封閉類別:
JScrollPane

protected class JScrollPane.ScrollBar
extends JScrollBar
implements UIResource

預設情況下,JScrollPane 創建的滾動條為此類別的實例。Scrollbar 覆寫 getUnitIncrementgetBlockIncrement 方法,所以如果視口的視圖為 Scrollable,會要求該視圖計算這些值。除非顯式設置了單位/塊增量。

警告:此類別的序列化物件將與以後的 Swing 版本不相容。當前的序列化支持適用於短期存儲或運行相同 Swing 版本的應用程序之間的 RMI。從 1.4 版本開始,已在 java.beans 套件中添加了支持所有 JavaBeansTM 長期存儲的功能。請參閱 XMLEncoder

另請參見:
Scrollable, JScrollPane.createVerticalScrollBar(), JScrollPane.createHorizontalScrollBar()

巢狀類別摘要
 
從類別 javax.swing.JScrollBar 繼承的巢狀類別/介面
JScrollBar.AccessibleJScrollBar
 
從類別 javax.swing.JComponent 繼承的巢狀類別/介面
JComponent.AccessibleJComponent
 
從類別 java.awt.Container 繼承的巢狀類別/介面
Container.AccessibleAWTContainer
 
從類別 java.awt.Component 繼承的巢狀類別/介面
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
欄位摘要
 
從類別 javax.swing.JScrollBar 繼承的欄位
blockIncrement, model, orientation, unitIncrement
 
從類別 javax.swing.JComponent 繼承的欄位
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
從類別 java.awt.Component 繼承的欄位
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
從介面 java.awt.Adjustable 繼承的欄位
HORIZONTAL, NO_ORIENTATION, VERTICAL
 
從介面 java.awt.image.ImageObserver 繼承的欄位
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
建構子摘要
JScrollPane.ScrollBar(int orientation)
          創建具有指定方向的滾動條。
 
方法摘要
 int getBlockIncrement(int direction)
          如果視口中的視圖為 Scrollable 物件,將計算滾動的塊增量值。
 int getUnitIncrement(int direction)
          如果視口中的視圖為 Scrollable 物件,將計算滾動的單位增量值。
 void setBlockIncrement(int blockIncrement)
          通知父級類別來設定該值,並將 blockIncrementSet 實例變數重置為 true。
 void setUnitIncrement(int unitIncrement)
          通知父級類別來設定該值,並將 unitIncrementSet 實例變數重置為 true。
 
從類別 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
 
從類別 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 
從類別 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, transferFocusBackward, 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, 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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
從類別 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

建構子詳細資訊

JScrollPane.ScrollBar

public JScrollPane.ScrollBar(int orientation)
創建具有指定方向的滾動條。方向包括:

參數:
orientation - 指定上面兩個合法方向值之一的整數
方法詳細資訊

setUnitIncrement

public void setUnitIncrement(int unitIncrement)
通知父級類別來設定該值,並將 unitIncrementSet 實例變數重置為 true。

指定者:
介面 Adjustable 中的 setUnitIncrement
覆寫:
類別 JScrollBar 中的 setUnitIncrement
參數:
unitIncrement - 新單位增量值,以像素為單位
從以下版本開始:
1.4
另請參見:
JScrollBar.getUnitIncrement(int)

getUnitIncrement

public int getUnitIncrement(int direction)
如果視口中的視圖為 Scrollable 物件,將計算滾動的單位增量值。否則返回 super.getUnitIncrement

覆寫:
類別 JScrollBar 中的 getUnitIncrement
參數:
direction - 小於零表示向上/左滾動,大於零表示向下/右滾動
返回:
包含單位增量的整數,以像素為單位
另請參見:
Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)

setBlockIncrement

public void setBlockIncrement(int blockIncrement)
通知父級類別來設定該值,並將 blockIncrementSet 實例變數重置為 true。

指定者:
介面 Adjustable 中的 setBlockIncrement
覆寫:
類別 JScrollBar 中的 setBlockIncrement
參數:
blockIncrement - 新的塊增量值,以像素為單位
另請參見:
JScrollBar.getBlockIncrement()

getBlockIncrement

public int getBlockIncrement(int direction)
如果視口中的視圖為 Scrollable 物件,將計算滾動的塊增量值。否則 blockIncrement 與視口的寬度或高度相等。如果無任何視口,則返回 super.getBlockIncrement

覆寫:
類別 JScrollBar 中的 getBlockIncrement
參數:
direction - 小於零表示向上/向左滾動,大於零表示向下/向右滾動
返回:
包含塊增量的整數,以像素為單位
另請參見:
Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)

JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only