Java Reference
In-Depth Information
Those ActionListener objects have no instance name and appear to have no class name: is
that possible? The former yes, but not the latter. In fact, class names are assigned to anonym-
ous inner classes by the compiler. After compiling and testing ButtonDemo2c , I list the dir-
ectory in which I ran the program:
C:\javasrc\gui> ls -1 ButtonDemo2c*
ButtonDemo2c$1.class
ButtonDemo2c$2.class
ButtonDemo2c.class
ButtonDemo2c.htm
ButtonDemo2c.java
C:\javasrc\gui>
Those first two are the anonymous inner classes. Note that a different compiler might assign
different names to them; it doesn't matter to us. A word to the wise: don't depend on those
names!
See Also
Most IDEs (see Compiling and Running Java: JDK ) have drag-and-drop GUI builder tools
that make this task easier, at least for simpler projects.
Action Handling Using Lambdas
Search WWH ::




Custom Search