O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inner Classes

The 1.1 version of the JDK introduced a handy new construct: inner classes. Our intent here is not to provide an in-depth discussion of inner classes—if you are so inclined, you can find such a discussion from the Java home page (http://java.sun.com). Instead, we will show how inner classes can be used for handling events.

Inner classes are pertinent to event handling because they can be used to simplify the relationship between event sources and listeners. In Java, a class can be a top-level class or an inner class. Top-level classes are members of a package and were the only type of classes in the 1.0 JDK. Inner classes are classes that can be defined within a block or as part of a new expression.

ThreeDButton

To start off with, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required