javax.swing.plaf.basic

Class BasicScrollBarUI.ScrollListener

protected class BasicScrollBarUI.ScrollListener extends Object implements ActionListener

A helper class that listens for events from the timer that is used to move the thumb.
Constructor Summary
ScrollListener()
Creates a new ScrollListener object.
ScrollListener(int dir, boolean block)
Creates a new ScrollListener object using the given direction and block.
Method Summary
voidactionPerformed(ActionEvent e)
Called every time the timer reaches its interval.
voidsetDirection(int direction)
Sets the direction to scroll in.
voidsetScrollByBlock(boolean block)
Sets whether scrolling will be done in blocks.

Constructor Detail

ScrollListener

public ScrollListener()
Creates a new ScrollListener object. The default is scrolling positively with block movement.

ScrollListener

public ScrollListener(int dir, boolean block)
Creates a new ScrollListener object using the given direction and block.

Parameters: dir The direction to move in. block Whether movement will be in blocks.

Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Called every time the timer reaches its interval.

Parameters: e The ActionEvent fired by the timer.

setDirection

public void setDirection(int direction)
Sets the direction to scroll in.

Parameters: direction The direction to scroll in.

setScrollByBlock

public void setScrollByBlock(boolean block)
Sets whether scrolling will be done in blocks.

Parameters: block Whether scrolling will be in blocks.