java.lang.Object java.util.EventObject java.awt.AWTEvent java.awt.event.ItemEvent
public class ItemEvent
A semantic event which indicates that an item was selected or deselected. This high-level event is generated by an ItemSelectable object (such as a List) when an item is selected or deselected by the user. The event is passed to every ItemListener
object which registered to receive such events using the component's addItemListener
method.
The object that implements the ItemListener
interface gets this ItemEvent
when the event occurs. The listener is spared the details of processing individual mouse movements and mouse clicks, and can instead process a "meaningful" (semantic) event like "item selected" or "item deselected".
ItemSelectable
, ItemListener
, Tutorial: Writing an Item Listener, Reference: The Java Class Libraries (update file), Serialized Form
static int
DESELECTED
static int
ITEM_FIRST
static int
ITEM_LAST
static int
ITEM_STATE_CHANGED
static int
SELECTED
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
ITEM_FIRST
public static final int ITEM_FIRST
public static final int ITEM_LAST
public static final int ITEM_STATE_CHANGED
public static final int SELECTED
public static final int DESELECTED
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange)
ItemEvent
object.
Note that passing in an invalid id
results in unspecified behavior. This method throws an IllegalArgumentException
if source
is null
.
source
- the ItemSelectable
object that originated the event
id
- an integer that identifies the event type
item
- an object -- the item affected by the event
stateChange
- an integer that indicates whether the item was selected or deselected
IllegalArgumentException
- if source
is null
public ItemSelectable getItemSelectable()
public Object getItem()
public int getStateChange()
SELECTED
, DESELECTED
public String paramString()
paramString
in class AWTEvent
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4