Example Programs
You can find source files for all of the examples from this chapter on the CD and online:
JavaTutorial/uiswing/learn/example-1dot4/index.html
http://java.sun.com/docs/books/tutorial/uiswing/learn/example-1dot4/index.html
The preceding URLs take you to an index that has links to the files required by each example. You can go directly to the entry for a particular example by adding #ExampleName to the URL. Most examples have a "Run" link in the index which executes the example using Java Web Start technology.
|
HelloWorldSwing | Page 12 | Demonstrates the basic code in every Swing program. | SwingApplication | Page 15 | Demonstrates setting up buttons and labels, adding components to a container, adding borders, and event handling. | CelsiusConverter | Page 21 | Shows event handling and the use of text fields in a simple temperature conversion tool. | CelsiusConverter2 | Page 22 | Adds color and boldface fonts to an improved temperature conversion tool. Also adds a graphic to the button and sets it as the default button. | LunarPhases | Page 25 | Shows how to use images in your application and how to implement combo boxes. | VoteDialog | Page 30 | Illustrates the use of dialogs and radio buttons. |
|