The JavaTM Tutorial

| 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 trail. In particular, you'll need to successfully follow the instructions in The "Hello World" Application 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:

> - Java 2 Platform, v 1.2 or 1.3
> - JDK 1.1 + JFC/Swing Release

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

> .

| Start of Tutorial > Start of Trail > Start of Lesson | Search Feedback Form