posted 22 years ago
Shetty,
ComponentEvent is not a superclass of ActionEvent; they both derive from AWTEvent, which has no getComponent() method.
Therefore, the getComponent() method is not applicable to events generated by an ActionEvent.
From the API:
Component events are provided for notification purposes ONLY; The AWT will automatically handle component moves and resizes
internally so that GUI layout works properly regardless of whether a program is receiving these events or not.
You must always use getSource() to isolate the sources of ActionEvents.