Sun JFC Samples

Objectives
To introduce and demonstrate the use of JDK features in sample applets and applications.

Time Required
3 hours to become familiar with the contents of the sample projects.

Before You Begin
To add sample projects to your workspace:

  1. Select Quick Start from the File menu.
  2. From the left-hand list, select Feature.
  3. From the right-hand list, select Add Feature.
  4. From the dialog that opens, select Sun JFC Examples.  If Sun JFC Examples does not appear in the list, it means that the projects have previously been added to your workspace.

The Sun JFC Examples projects will be added to your workspace, and the source code will be compiled.

Description
The Sun JFC samples in VisualAge for Java are the samples provided with Sun's JFC product.  You can run, edit, and manage them within the IDE.   See the README.txt file in each of the the sample projects' project_resources subdirectories for information on working with each of the samples.

Running a Sample
To run one of the samples:

  1. Find the executable class for the sample.
  2. From the class' pop-up menu, select Run and then either In Applet Viewer (to run as an applet) or Run Main (to run as an application), which ever is enabled.
  3. If the class runs as an applet, the Applet Viewer will start.  If the program uses standard input or output, the Console window will start.

List of JFC Samples

Sample Name Description
FileChooserDemo Demonstrates the File Chooser bean.
MetalWorks A simulated e-mail program that demonstrates several Swing features.   See ide\project_resources\Sun JFC MetalWorks\README.txt.
Notepad Simple text editor that demonstrates the Swing look-and-feel menus, toolbars, file chooser, and so on.
SampleTree Demonstrates using JTree.  See ide\project_resources\Sun JFC SampleTree\README.txt.
SimpleExample Demonstrates three different button and radio button look-and-feel styles.
StylePad Builds on the Notepad example.  Provides font style, alignment, size, and color manipulation.
SwingApplet A most-basic applet, containing a swing button.
SwingSet Demonstrates all Swing components.
Table Demonstrates using JTable for working with database tables.  See ide\project_resources\Sun JFC Table\README.txt and ide\project_resources\Sun JFC DBDemos\README.txt.