tags:

views:

39

answers:

1

How can I find what event a JComponent can send?

From JDK documentation is not so clear to find all the event an object sands.

For example a JButton send an ActionEvent but this is not listed into the API of the JButton

+5  A: 

All of the events that can be sent by a component follow the same pattern. The component will have a method for each event which looks like addXXXXXListener(XXXX). Just look for the methods that start with "add" and end with "listener"

Jay Askren
+1 See also `EventListener` http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/util/EventListener.html and `EventListenerList` http://java.sun.com/javase/6/docs/api/javax/swing/event/EventListenerList.html
trashgod