APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt.event

public Class AdjustmentEvent

extends AWTEvent
Class Inheritance
Imports
java.awt.AWTEvent, .Adjustable, java.io.Serial, java.lang.annotation.Native

The adjustment event emitted by Adjustable objects like java.awt.Scrollbar and java.awt.ScrollPane. When the user changes the value of the scrolling component, it receives an instance of AdjustmentEvent.

An unspecified behavior will be caused if the id parameter of any particular AdjustmentEvent instance is not in the range from ADJUSTMENT_FIRST to ADJUSTMENT_LAST.

The type of any AdjustmentEvent instance takes one of the following values:

Assigning the value different from listed above will cause an unspecified behavior.
Author
Amy Fowler
Since
1.1
See Also
java.awt.Adjustable, AdjustmentListener

Field Summary

Modifier and TypeField and Description
pack-priv Adjustable
adjustable

The adjustable object that fired the event.

public static final int
ADJUSTMENT_FIRST

Marks the first integer id for the range of adjustment event ids.

public static final int
ADJUSTMENT_LAST

Marks the last integer id for the range of adjustment event ids.

public static final int
ADJUSTMENT_VALUE_CHANGED

The adjustment value changed event.

pack-priv int
adjustmentType

The adjustmentType describes how the adjustable object value has changed.

public static final int
BLOCK_DECREMENT

The block decrement adjustment type.

public static final int
BLOCK_INCREMENT

The block increment adjustment type.

pack-priv boolean
isAdjusting

The isAdjusting is true if the event is one of the series of multiple adjustment events.

private static final long
serialVersionUID

Hides java.awt.AWTEvent.serialVersionUID.

Use serialVersionUID from JDK 1.1 for interoperability.
public static final int
TRACK

The absolute tracking adjustment type.

public static final int
UNIT_DECREMENT

The unit decrement adjustment type.

public static final int
UNIT_INCREMENT

The unit increment adjustment type.

pack-priv int
value

value will contain the new value of the adjustable object.

Inherited from java.awt.AWTEvent:
ACTION_EVENT_MASKADJUSTMENT_EVENT_MASKCOMPONENT_EVENT_MASKconsumedCONTAINER_EVENT_MASKFOCUS_EVENT_MASKHIERARCHY_BOUNDS_EVENT_MASKHIERARCHY_EVENT_MASKidINPUT_METHOD_EVENT_MASKINVOCATION_EVENT_MASKITEM_EVENT_MASKKEY_EVENT_MASKMOUSE_EVENT_MASKMOUSE_MOTION_EVENT_MASKMOUSE_WHEEL_EVENT_MASKPAINT_EVENT_MASKRESERVED_ID_MAXTEXT_EVENT_MASKWINDOW_EVENT_MASKWINDOW_FOCUS_EVENT_MASKWINDOW_STATE_EVENT_MASK

Constructor Summary

AccessConstructor and Description
public
AdjustmentEvent(Adjustable
The Adjustable object where the event originated
source
,
int
An integer indicating the type of event. For information on allowable values, see the class description for AdjustmentEvent
id
,
int
An integer indicating the adjustment type. For information on allowable values, see the class description for AdjustmentEvent
type
,
int
The current value of the adjustment
value
)

Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

public
AdjustmentEvent(Adjustable
The Adjustable object where the event originated
source
,
int
An integer indicating the type of event. For information on allowable values, see the class description for AdjustmentEvent
id
,
int
An integer indicating the adjustment type. For information on allowable values, see the class description for AdjustmentEvent
type
,
int
The current value of the adjustment
value
,
boolean
A boolean that equals true if the event is one of a series of multiple adjusting events, otherwise false
isAdjusting
)

Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

Method Summary

Modifier and TypeMethod and Description
public Adjustable

Returns:

the Adjustable object where this event originated
getAdjustable
()

Returns the Adjustable object where this event originated.

public int

Returns:

one of the adjustment values listed above
getAdjustmentType
()

Returns the type of adjustment which caused the value changed event.

public int

Returns:

the current value in the adjustment event
getValue
()

Returns the current value in the adjustment event.

public boolean

Returns:

true if this is one of multiple adjustment events, otherwise returns false
getValueIsAdjusting
()

Returns true if this is one of multiple adjustment events.

public String
paramString()

Overrides java.awt.AWTEvent.paramString.

Returns a string representing the state of this Event.

Inherited from java.awt.AWTEvent:
consumegetIDisConsumedsetSourcetoString

Field Detail

adjustableback to summary
pack-priv Adjustable adjustable

The adjustable object that fired the event.

Annotations
@SuppressWarnings:serial
See Also
getAdjustable
ADJUSTMENT_FIRSTback to summary
public static final int ADJUSTMENT_FIRST

Marks the first integer id for the range of adjustment event ids.

ADJUSTMENT_LASTback to summary
public static final int ADJUSTMENT_LAST

Marks the last integer id for the range of adjustment event ids.

ADJUSTMENT_VALUE_CHANGEDback to summary
public static final int ADJUSTMENT_VALUE_CHANGED

The adjustment value changed event.

adjustmentTypeback to summary
pack-priv int adjustmentType

The adjustmentType describes how the adjustable object value has changed. This value can be increased/decreased by a block or unit amount where the block is associated with page increments/decrements, and a unit is associated with line increments/decrements.

See Also
getAdjustmentType
BLOCK_DECREMENTback to summary
public static final int BLOCK_DECREMENT

The block decrement adjustment type.

Annotations
@Native
BLOCK_INCREMENTback to summary
public static final int BLOCK_INCREMENT

The block increment adjustment type.

Annotations
@Native
isAdjustingback to summary
pack-priv boolean isAdjusting

The isAdjusting is true if the event is one of the series of multiple adjustment events.

Since
1.4
See Also
getValueIsAdjusting
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.AWTEvent.serialVersionUID.

Use serialVersionUID from JDK 1.1 for interoperability.

Annotations
@Serial
TRACKback to summary
public static final int TRACK

The absolute tracking adjustment type.

Annotations
@Native
UNIT_DECREMENTback to summary
public static final int UNIT_DECREMENT

The unit decrement adjustment type.

Annotations
@Native
UNIT_INCREMENTback to summary
public static final int UNIT_INCREMENT

The unit increment adjustment type.

Annotations
@Native
valueback to summary
pack-priv int value

value will contain the new value of the adjustable object. This value will always be in a range associated adjustable object.

See Also
getValue

Constructor Detail

AdjustmentEventback to summary
public AdjustmentEvent(Adjustable source, int id, int type, int value)

Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

This method throws an IllegalArgumentException if source is null.

Parameters
source:Adjustable

The Adjustable object where the event originated

id:int

An integer indicating the type of event. For information on allowable values, see the class description for AdjustmentEvent

type:int

An integer indicating the adjustment type. For information on allowable values, see the class description for AdjustmentEvent

value:int

The current value of the adjustment

Exceptions
IllegalArgumentException:
if source is null
See Also
getSource(), getID(), getAdjustmentType(), getValue()
AdjustmentEventback to summary
public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)

Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

This method throws an IllegalArgumentException if source is null.

Parameters
source:Adjustable

The Adjustable object where the event originated

id:int

An integer indicating the type of event. For information on allowable values, see the class description for AdjustmentEvent

type:int

An integer indicating the adjustment type. For information on allowable values, see the class description for AdjustmentEvent

value:int

The current value of the adjustment

isAdjusting:boolean

A boolean that equals true if the event is one of a series of multiple adjusting events, otherwise false

Exceptions
IllegalArgumentException:
if source is null
Since
1.4
See Also
getSource(), getID(), getAdjustmentType(), getValue(), getValueIsAdjusting()

Method Detail

getAdjustableback to summary
public Adjustable getAdjustable()

Returns the Adjustable object where this event originated.

Returns:Adjustable

the Adjustable object where this event originated

getAdjustmentTypeback to summary
public int getAdjustmentType()

Returns the type of adjustment which caused the value changed event. It will have one of the following values:

Returns:int

one of the adjustment values listed above

getValueback to summary
public int getValue()

Returns the current value in the adjustment event.

Returns:int

the current value in the adjustment event

getValueIsAdjustingback to summary
public boolean getValueIsAdjusting()

Returns true if this is one of multiple adjustment events.

Returns:boolean

true if this is one of multiple adjustment events, otherwise returns false

Since
1.4
paramStringback to summary
public String paramString()

Overrides java.awt.AWTEvent.paramString.

Doc from java.awt.AWTEvent.paramString.

Returns a string representing the state of this Event. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.