Examples from Java Examples in a Nutshell, 1st Edition

Note: Examples from the 2nd edition of Java Examples in a Nutshell may be found at http://examples.oreilly.com/jenut2/2nd_edition.

This directory contains the complete set of examples from the book Java Examples in a Nutshell, 1st Edition. You can browse the examples online or download the complete set to compile and run locally on your computer.

The code in these example archives may not match the examples in the latest print copy of the book. Please check the posted errata for discrepancies between the book and online errata. We apologize for the inconvenience.

Download:

Note to Windows users: the examples include files with long file names, so if you download the examples.zip file, be sure to unzip it with a modern unzip program that is capable of handling file names with more than eight characters!

A number of these examples are applets. Note, however, that this file does not provide links that allow you to run the applets directly. This is because most of the applets rely on new features of Java 1.1, and there are many Web browsers that do not yet have sufficient support for Java 1.1 to run them. The directory contains appropriate HTML files for each of the applets. To run one of these applets, compile the Java source file, then use appletviewer to view the corresponding HTML file.

Note that the examples are all placed in a single large directory, instead of being grouped into subdirectories by chapter. This is because there are interdependencies between many of the examples, and they will not compile unless they are in the same directory. (The exception to the single-directory rule is the examples from Chapter 11, Java Beans. The examples from that chapter are placed in packages and are found in the oreilly/beans/ subdirectory.) Despite the fact that there are 119 Java source files in a single directory, it is easy to find any example from the book: the caption of each example in the book is the name of the source file for that example. Example 6-8, for example, is captioned Example 6-8: ColumnLayout.java, and you can find the source code for this program in the file ColumnLayout.java.

See the files README and LICENSE for other important information about these examples.