What interface are you implementing?
> which one is better to use for a JCheckBoxMenuItem:
> - itemStateChanged
> or
> - stateChanged
That depends on what you want to do with it.
ChangeListener (stateChanged) is a very general interface which is use by
many different components. ChangeEvents are usually fired when *any*
state changes. A JCheckBoxMenuItem will fire a change event when the menu
item is armed, highlighted, selected, etc, and you will normally receive
many ChangeEvents as the user interacts with the JCheckBoxMenuItem. The
event will not tell you anything about what changed - you will need to
look at the event source and figure that out yourself.
ItemListener (itemStateChanged) is used for components that can be
selected or deselected, such as toggle buttons, checkboxes and radio
buttons. You will receive a single ItemEvent each time the selection
changes and the event has a getStateChange() method that will tell you
whether it was a selection or deselection.

Signature
Regards,
John McGrath
Nomak - 29 Apr 2005 08:51 GMT
> > which one is better to use for a JCheckBoxMenuItem:
> > - itemStateChanged
[quoted text clipped - 16 lines]
> changes and the event has a getStateChange() method that will tell you
> whether it was a selection or deselection.
thx a lot