This section of the course notes is meant to answer a few of the most common questions about the Java Foundation Classes (JFC) and Swing. In doing so, we will provide you with an overview of each of them, including their structure and possible ways to approach building a JFC/Swing based Graphical User Interface (GUI).

What is the JFC? The Java Foundation Classes (JFC) are a bunch of related features, widgets, containers, etc. They are related in that they are all commonly used tools for building GUIs. The JFC is a large entity and we will not cover it entirely. Instead, we will provide you with an overview of what is included in the JFC, and go into detail with a few of the more common and useful components in later sections of the course notes.

What does the JFC contain?

As stated above, the JFC contains various features related to GUI development. Here is a listing of its contents:

This course will concentrate on the Swing Components and their usage. Once you are comfortable building GUIs using the Swing components, the other areas of the JFC can be explored and learned on your own.

Which releases of Java contain the Swing API?

It should be noted that the Swing API comes in two forms. The first form, which is a standard part of the Java 2 platform (Java Development Kit (JDK) v1.2 and v1.3), is the form that we will be using in the labs. If you wish to download a copy of the JDK for your home machine and for some reason you are unable to get your hands on a Java 2 release, the Swing API is available for JDK v1.1 as an additional package of libraries named JFC 1.1.

Packages you will be using

The Swing API is a large collection of classes to say the least, and the JFC is even larger. But what packages will we be using to power our GUIs? As it turns out, we will really only need four packages javax.swing, javax.swing.event, java.awt, and java.awt.event. You will be able to create GUIs of medium complexity using only these packages. In fact, in most cases, only the first package is needed.

Compiling and Running Swing Applications and Applets

Since you already know how to compile and run regular Java applications and applets, you already know how to compile and run applications and applets that use Swing features. It is because the Swing packages are incorporated as part of the Java 2 platform that things are so simple. All you have to do is be sure to import the appropriate Swing package(s) at the beginning of your program. In any case, the remainder of this tutorial assumes that you are already comfortable with compiling and running Java applications and applets.