Module java.desktop
Package 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)

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部