The Java Tutorial contains hundreds of complete working examples. Some of our examples are applets, others are standalone applications. For a complete list of the tutorial's applets, and what page to visit to run each one, refer to List of Applets.
This page contains four sections that discuss various aspects of our examples:
Each lesson in the tutorial contains one or more programming examples, each of which can be composed of one or more files. A lesson groups its examples in sub-directories according to the version of the Java 2 SDK required and whether Swing is required.A lesson might have one or more of the following example directories (from most up-to-date to least):
Example Directory Name Java 2 SDK Release/Version Other libraries example-1dot4
Java 2 SDK 1.4 example-1dot3
Java 2 SDK 1.3 example-1dot2
Java 2 SDK 1.2 example-swing
JDK 1.1 JFC/Swing 1.1 example-1dot1
JDK 1.1 example
JDK 1.0.2
Often, you can find multiple versions of the same program by looking in each of the example directories in a lesson. For example, you might find a JDK 1.0.2 version of a program inexample
and a JDK 1.1 version of the same program inexample-1dot1
.We provide multiple versions of the same program for several reasons:
- Some developers can't upgrade to the latest version of the Java 2 SDK right away because of existing applications and users.
- It's often useful to compare two different versions of the same program to learn what kinds of changes are required to migrate from one release to the next.
- Because browser support for applets has historically lagged the current release of the Java Platform, we sometimes provide multiple versions of each applet -- one that uses the latest version of the Java 2 SDK, and one that users can run within less up-to-date browsers.
- Some of the programs have been around since the original release of the Java 2 SDK (formerly known as the JDK). Each version of the program represents a step in the natural migration of the program as the platform evolves.
Throughout the tutorial, you will encounter running applets. Our pages use the APPLET tag, which (for applets that use API introduced after 1.1, at least) requires Java Plug-in version 1.3.1 or greater. Most applets are followed by a note like this:
Note: If you don't see the applet running above, you need to install Java Plug-in, which happens automatically when you install the J2SE JRE or SDK. We strongly recommend that you install the latest version; at least 1.3.1 is required for all our applets. You can find more information in the Java Plug-in home page.