Recipe 1.5 Using the com.darwinsys API Classes from This Book


You want to try out my example code and/or use my utility classes.


I have built up a fairly sizeable collection of reusable classes into my own API, which I use in my own Java projects. I use example code from it throughout this book, and I use classes from it in many of the other examples. So, if you're going to be downloading and compiling the examples individually, you should first download the file darwinsys.jar and include it in your CLASSPATH. Note that if you are going to build all of my source code (as in Recipe 1.6), you can skip this download because the top-level Ant file starts off by building the JAR file for this API.


I have split the com.darwinsys.util package from the first edition of this book into about a dozen com.darwinsys packages, listed in Table 1-1. I have also added many new classes; these packages now include approximately 50 classes and interfaces. You can peruse the documentation online at

Table 1-1. The com.darwinsys packages

Package name

Package description


Classes for dealing with databases in a general way


Classes (only one so far) for dealing with HTML

Classes for input and output operations, using Java's underlying I/O classes


Classes for dealing with standard features of Java


Classes for dealing with Swing GUIs slightly differently under Mac OS X


Classes for dealing with e-mail, mainly a convenience class for sending mail


Classes for dealing with SQL databases


Classes for helping construct and use Swing GUIs


A few interesting LayoutManager implementations


A few miscellaneous utility classes

Many of these classes are used as examples in this book; just look for files whose first line is:

package com.darwinsys.nnn;

You'll also find that many examples have imports from the com.darwinsys packages.

Java Cookbook
Java Cookbook, Second Edition
ISBN: 0596007019
EAN: 2147483647
Year: 2003
Pages: 409
Authors: Ian F Darwin

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: