The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Creating a GUI with JFC/Swing
Lesson: Getting Started with Swing

Compiling and Running Swing Programs

This section tells you how to compile and run a Swing application. The compilation instructions work for all Swing programs -- applets, as well as applications. If you're interested in Swing applets, you should also read Running Swing Applets. If you aren't yet interested in compiling and running Swing programs, you can skip directly to A Quick Tour of a Swing Application's Code, which guides you through the code for a simple application.

The instructions in this section assume that you're already comfortable with writing and compiling programs that use the Java platform. If you aren't, please go to the Getting Started(in the Creating a GUI with JFC/Swing trail) trail. In particular, you'll need to successfully follow the instructions in A Closer Look at HelloWorld(in the Creating a GUI with JFC/Swing trail) before you attempt to compile and run any Swing programs.

How you compile and run Swing programs depends on whether you're using JDK 1.1 or the Java 2 Platform. Using the Java 2 Platform is a bit simpler because Swing is built into it. Choose the instructions corresponding to the release you're using:

Both instructions tell you how to run a simple program, called SwingApplication, whose GUI looks like this:

SwingApplication

.

Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2002 Sun Microsystems, Inc. All rights reserved.