java.awt.event
public class ItemEvent extends AWTEvent
Since: 1.1
See Also: ItemSelectable ItemListener
UNKNOWN: updated to 1.4
Field Summary | |
---|---|
static int | DESELECTED This type indicates that the item was deselected. |
static int | ITEM_FIRST This is the first id in the event id range used by this class. |
static int | ITEM_LAST This is the last id in the event id range used by this class. |
static int | ITEM_STATE_CHANGED This event id indicates a state change occurred. |
static int | SELECTED This type indicates that the item was selected. |
Constructor Summary | |
---|---|
ItemEvent(ItemSelectable source, int id, Object item, int stateChange)
Initializes a new instance of ItemEvent with the specified
source, id, and state change constant. |
Method Summary | |
---|---|
Object | getItem()
Returns the item affected by this state change.
|
ItemSelectable | getItemSelectable()
This method returns the event source as an ItemSelectable .
|
int | getStateChange()
Returns the type of state change, either {@link #SELECTED} or
{@link #DESELECTED}.
|
String | paramString()
Returns a string identifying this event. |
ItemEvent
with the specified
source, id, and state change constant. Note that an invalid id leads to
unspecified results.
Parameters: source the source of the event id the event id item the item affected by the state change stateChange one of {@link #SELECTED} or {@link #DESELECTED}
Returns: the item affected by this state change
ItemSelectable
.
Returns: the event source as an ItemSelected
Throws: ClassCastException if source is changed to a non-ItemSelectable
Returns: the type of state change
"ITEM_STATE_CHANGED,item=" + item + ",stateChange="
+ (getStateChange() == DESELECTED ? "DESELECTED" : "SELECTED")
.
Returns: a string identifying this event