Класс JScrollPane.ScrollBar
- Все реализуемые интерфейсы:
Adjustable, ImageObserver, MenuContainer, Serializable, Accessible, UIResource
- Внешний класс:
JScrollPane
protected class JScrollPane.ScrollBar extends JScrollBar implements UIResource
JScrollPane создаёт полосы прокрутки, являющиеся экземплярами этого класса. Scrollbar переопределяет методы getUnitIncrement и getBlockIncrement, чтобы, если представление области просмотра является Scrollable, запросить у представления вычисление этих значений. Это происходит, если приращения единицы или блока не были заданы явно. Предупреждение: Сериализованные объекты этого класса могут быть несовместимы с будущими выпусками Swing. Текущая поддержка сериализации подходит для кратковременного хранения или RMI между приложениями, работающими с одной и той же версией Swing. Начиная с версии 1.4 в пакет java.beans добавлена поддержка долгосрочного хранения всех JavaBeans. См. XMLEncoder.
- Начиная с:
- 1.2
- См. также:
Краткое описание вложенных классов
Вложенные классы и интерфейсы, объявленные в классе JScrollBar
JScrollBar.AccessibleJScrollBar
Вложенные классы и интерфейсы, объявленные в классе JComponent
JComponent.AccessibleJComponent
Вложенные классы и интерфейсы, объявленные в классе Container
Container.AccessibleAWTContainer
Вложенные классы и интерфейсы, объявленные в классе Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Краткое описание полей
Поля, объявленные в классе JScrollBar
blockIncrement, model, orientation, unitIncrement
Поля, объявленные в классе JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Поля, объявленные в классе Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Поля, объявленные в интерфейсе Adjustable
HORIZONTAL, NO_ORIENTATION, VERTICAL
Поля, объявленные в интерфейсе ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Краткое описание конструкторов
| Конструктор | Описание |
|---|---|
ScrollBar |
Создаёт полосу прокрутки с указанной ориентацией. |
Краткое описание методов
| Модификатор и тип | Метод | Описание |
|---|---|---|
int |
getBlockIncrement |
Вычисляет приращение блока прокрутки, если представление области просмотра является объектом Scrollable. |
int |
getUnitIncrement |
Вычисляет приращение единицы прокрутки, если представление области просмотра является объектом Scrollable. |
void |
setBlockIncrement |
Вызывает соответствующий метод суперкласса для установки значения и сбрасывает переменную экземпляра blockIncrementSet в true. |
void |
setUnitIncrement |
Вызывает соответствующий метод суперкласса для установки значения и сбрасывает переменную экземпляра unitIncrementSet в true. |
Методы, объявленные в классе JScrollBar
addAdjustmentListener, fireAdjustmentValueChanged, getAccessibleContext, getAdjustmentListeners, getBlockIncrement, getMaximum, getMaximumSize, getMinimum, getMinimumSize, getModel, getOrientation, getUI, getUIClassID, getUnitIncrement, getValue, getValueIsAdjusting, getVisibleAmount, paramString, removeAdjustmentListener, setEnabled, setMaximum, setMaximumSize, setMinimum, setMinimumSize, setModel, setOrientation, setUI, setValue, setValueIsAdjusting, setValues, setVisibleAmount, updateUI
Методы, объявленные в классе 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, 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, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Методы, объявленные в классе 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
Методы, объявленные в классе 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
Подробное описание конструкторов
ScrollBar
public ScrollBar(int orientation)
-
ScrollPaneConstants.VERTICAL -
ScrollPaneConstants.HORIZONTAL
- Параметры:
-
orientation— целое число, указывающее одно из допустимых значений ориентации, перечисленных выше - Начиная с:
- 1.4
Подробное описание методов
setUnitIncrement
public void setUnitIncrement(int unitIncrement)
unitIncrementSet в true.- Определено в:
-
setUnitIncrementв интерфейсеAdjustable - Переопределяет:
-
setUnitIncrementв классеJScrollBar - Параметры:
-
unitIncrement— новое значение приращения единицы в пикселях - См. также:
getUnitIncrement
public int getUnitIncrement(int direction)
Scrollable. В противном случае возвращает super.getUnitIncrement.- Переопределяет:
-
getUnitIncrementв классеJScrollBar - Параметры:
-
direction— меньше нуля для прокрутки вверх/влево, больше нуля — вниз/вправо - Возвращает:
- целое число, содержащее приращение единицы в пикселях
- См. также:
setBlockIncrement
public void setBlockIncrement(int blockIncrement)
blockIncrementSet в true.- Определено в:
-
setBlockIncrementв интерфейсеAdjustable - Переопределяет:
-
setBlockIncrementв классеJScrollBar - Параметры:
-
blockIncrement— новое значение приращения блока в пикселях - См. также:
getBlockIncrement
public int getBlockIncrement(int direction)
Scrollable. В противном случае blockIncrement равно ширине или высоте области просмотра. Если область просмотра отсутствует, возвращает super.getBlockIncrement.- Переопределяет:
-
getBlockIncrementв классеJScrollBar - Параметры:
-
direction— меньше нуля для прокрутки вверх/влево, больше нуля — вниз/вправо - Возвращает:
- целое число, содержащее приращение блока в пикселях
- См. также:
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/javax/swing/JScrollPane.ScrollBar.html