Contents |
The Creating a User Interface (with Swing) trail covers everything you need to know about creating a user interface (UI) for a Java program.
Note: We are in the process of converting this trail to use the Swing components instead of the AWT components. The Swing components, which are part of the Java Foundation Classes (JFC), can be used with either JDK 1.1 or JDK 1.2. See Using the JFC/Swing Packages for details.
Overview of the Java UI tells you about the pieces the Java environment provides for building UIs. It introduces you to the graphical UI components and other UI-related classes provided in the Java environment. It also gives an overview of how programs display themselves and how they handle events such as mouse clicks. You should fully understand the information in this lesson before going on to other lessons in this trail.
Note: This lesson has not yet been converted to Swing.Using Components, the GUI Building Blocks tells you how to use each of the AWT UI components. It also has detailed discussions of implementing custom components, handling events in the 1.1 AWT event system, and the component architecture.
Note: This lesson has not yet been converted to Swing. For information about the Swing components, see the next lesson.Using the JFC/Swing Packages tells you how to download and use the Swing release, which is part of the JFC. This lesson has detailed discussions of using each Swing component and other commonly used Swing API.
Laying Out Components within a Container tells you how to choose a layout manager, how to use each of the layout manager classes the Java environment provides, how to use absolute positioning instead of a layout manager, and how to create your own layout manager. It also discusses solutions to common layout problems.
Note: If you'd like to see the pre-Swing version of this lesson, you can download the old UI trail.Working with Graphics tells you how to do everything from drawing lines and text to loading, displaying, and manipulating images. It includes information on performing animation and on improving graphics performance.
Note: This lesson has not yet been converted to Swing.
A Note about the Examples: Many of the example programs in this chapter are applets. This lets you easily run them just by visiting the relevant pages in the online tutorial. But don't let the fact that the examples are applets confuse you -- writing an application with a GUI is very similar to writing an applet with a GUI. See Component Problems (and Their Solutions) for information on the differences between applets and applications, and on converting an applet into an application.
Contents |