posted 16 years ago
The ActionEvent class has a getActionCommand method. The ItemEvent class does not. However, both classes have access to their superclass (EventObject) method getSource which is used to get a reference to the component that generated the event. In the case of a class extending AbstractButton (JButton, JMenuItem and JToggleButton) there is also a getActionCommand method. JCheckBox extends from JToggleButton so it has access to the getActionCommand method of AbstractButton.
So how might this work?