The AdjustmentEvent class in java programming


An AdjustmentEvent  is generated by a scroll bar.There are five types of adjustment events .The AdjustmentEvent  class defines integer constants that can be used to identity them,The constants and their meanings are shown

BLOCK_DECREMENT  -The user clicked inside the scroll bar to decrease its value
BLOCK_INCREMENT -The user clicked inside the scroll bar to increase its value
TRACK  -The slider was dragged
UNIT_DECREMENT -The button at the end of the scroll bar was clicked to decrease its value.
UNIT_INCREMENT -The button at the end of the scroll bar was clicked to increase its value


In addition there is an integer constant ADJUSTMENT_VALUE_CHANGED, that indicates that a change has occurred

AdjustmentEvent(adjustable src,int id,int type,int data)

Adjustable getAdjustable()

The geAdjustable() method returns the object that generated the event

int getAdjustmentType()

The type of the adjustmewnt event may be obtained by the getAdjustmentType() method.it returns one of the constants defined by AdjustmentEvent

int getValue()

 the amount of the adjustment can be obtained from the getValue() method

0 comments:

Post a Comment

 

learn java programming Copyright © 2011-2012 | Powered by appsackel.org