Through this chapter of study, when our methods of work have changed dramatically in AWT (if you can recall a long time ago, when Java first came out, Sun announced that Java is a "stable, solid" programming language), it may have been a very immature Java feeling. Indeed, Java now has a good event model and an excellent component reuse design--javabeans. But the GUI component looks quite primitive, clumsy, and quite abstract.
Note: When writing this section, the Swing library has obviously been "fixed" by sun, so as long as you download and install the Swing library, you should be able to compile and run the code correctly, without any problems (you should be able to compile the demo provided by Sun to detect if the installation is correct). If you are having any trouble, please visit http://www.BruceEckel.com for recent updates.
And that's where swing is going to occupy. The Swing library is available after Java 1.1, so we can naturally assume that it is part of Java 1.2. However, it is designed to work as a supplement in Java version 1.1. In this way, we don't have to wait for our platform to support the Java 1.2 version in order to enjoy the good UI component library. If the swing library is not part of our user's Java version 1.1 and has some surprises, then he might actually need to download the swing library.
Swing contains all the components that we lack, throughout the remainder of this chapter: we expect to understand the modern UI, and any events from the button include pictures in the tree and grid structure. It's a big library, but in some ways it's designed to be complex for tasks--if everything is simple, we don't have to write more code, but it's also getting more complicated to run our code. This means an easy entrance, and if we need it we get the power of it.
Swing is rather esoteric, and this section will not attempt to get the reader to understand, but will introduce its capabilities and swing simply to get us started using the library. Please note that our conscious use of all this becomes simple. If we need to run more, swing can give us what we want, and if we are willing to delve into it, we can get more information from Sun's online documentation.