Java™ Platform
Standard Ed. 8
javax.swing

Class JScrollPane.ScrollBar

    • Constructor Detail

      • ScrollBar

        public ScrollBar(int orientation)
        Creates a scrollbar with the specified orientation. The options are:
        • ScrollPaneConstants.VERTICAL
        • ScrollPaneConstants.HORIZONTAL
        Parameters:
        orientation - an integer specifying one of the legal orientation values shown above
        Since:
        1.4
    • Method Detail

      • getUnitIncrement

        public int getUnitIncrement(int direction)
        Computes the unit increment for scrolling if the viewport's view is a Scrollable object. Otherwise return super.getUnitIncrement.
        Overrides:
        getUnitIncrement in class JScrollBar
        Parameters:
        direction - less than zero to scroll up/left, greater than zero for down/right
        Returns:
        an integer, in pixels, containing the unit increment
        See Also:
        Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)
      • getBlockIncrement

        public int getBlockIncrement(int direction)
        Computes the block increment for scrolling if the viewport's view is a Scrollable object. Otherwise the blockIncrement equals the viewport's width or height. If there's no viewport return super.getBlockIncrement.
        Overrides:
        getBlockIncrement in class JScrollBar
        Parameters:
        direction - less than zero to scroll up/left, greater than zero for down/right
        Returns:
        an integer, in pixels, containing the block increment
        See Also:
        Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)
Java™ Platform
Standard Ed. 8

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部