February 2014
Beginner
1248 pages
62h 25m
English
Every JComponent has an instance variable called listenerList that refers to an object of class event-listenerList (package javax.swing.event). Each object of a JComponent subclass maintains references to its registered listeners in the listenerList. For simplicity, we’ve diagramed listenerList as an array below the JTextField object in Fig. 12.13.
Fig. 12.13 | Event registration for JTextField textField1.
When the following statement (line 43 of Fig. 12.9) executes
textField1.addActionListener(handler);
a new entry containing a reference to the TextFieldHandler object is placed in textField1 ...
Read now
Unlock full access