The ItemEvent class in java programming

An itemEvent is generated when a check or a list item is clicked or when a check able menu item is selected or deselected .There are two types of item events,which are identified by the following integer

DESELECTED
the user deselected an item

SELECTED 
the use selected an item

in addition ItemEvent defines one integer constant ITEM_STATE_CHANGED that signifies a change of state

ItemEvent has this constructor

ItemEvent(ItemSelectable src,int type,Object entry,int state)






getItem()


The getItem() method can be used to obtain a reference to the item that generated an event .Its signature is show here

Object getItem()

getItemSelectable()

The getItemSelectable() method can be used to obtain a reference to the ItemSelectable object that generated an event

ItemSelectable getItemSelectable()

getStateChange()

The getStateChange() method returns the satechange for the event

int getStateChange()

0 comments:

Post a Comment

 

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