README Welcome to this Swing release! This release includes the Swing libraries, some examples, and API documentation. This file has four sections: - Quick Start - Using Swing Components in an IDE - Compiling and Running Swing Applications without an IDE - What's In This Release ----------------------------------------------------------- VERSION NOTES This release is called Swing 1.1 Beta 2 (also known as JFC 1.1). It contains almost the same API as Swing 1.1 Beta (which is provided as part of the JDK 1.2 beta 4 release), but adds many performance enhancements and bug fixes. For details, see CHANGES.txt. This Swing release relies on bug fixes first released in JDK 1.1.5. If you don't have 1.1.5 or a later release, please get it. We recommend building Swing applications with the most current JDK release. See the following URL for information on downloading the JDK: http://java.sun.com/products/jdk/1.1 --------------------------------------------------------- =========== Quick Start =========== Please read the License (LICENSE.txt) before using this release. Please visit the Swing Web site, The Swing Connection. That's the place where we're putting the information developers ask us for the most, with the content coming straight from the designers and implementers of Swing. Here's the URL: http://java.sun.com/products/jfc/tsc/ The Java Tutorial has ever-growing coverage of Swing. To view the Swing section of the Tutorial, point your Web browser at this URL: http://java.sun.com/Series/Tutorial/ui/swing/ The remainder of this section tells you how to run an application (SwingSet) that showcases all the Swing components. A. If you're running Solaris: ----------------------------- 1. Set your JAVA_HOME environment variable to be the top directory of the JDK release you're using. For example: setenv JAVA_HOME /home/me/jdk1.1.6 2. Go to the examples directory, and then to its SwingSet subdirectory. 3. Execute the runnit command: runnit 4. If it doesn't run successfully, unset your CLASSPATH environment variable and type runnit again: unsetenv CLASSPATH runnit 5. Read the README.txt file in the SwingSet directory for help using the SwingSet example. B. If you're running Windows NT: --------------------------------- 1. Double-click the System icon inside the Control Panel. When the System Properties dialog box opens, place the following variables in the lower list box, which is labeled "User Variables." (Be careful not to change your system environment variables, which appear in the upper list box.) JAVA_HOME C:\JDK1.1.6 SWING_HOME C:\swing-1.1beta2 CLASSPATH .;%JAVA_HOME%\lib\classes.zip PATH %PATH%;%JAVA_HOME%\bin These settings assume that you have installed both the JDK and the Swing tool set on drive C. If either these toolkits has been installed on a different drive, substitute that drive's designator wherever it is appropriate. 2. From the Windows Start menu or from the Control Panel, open a console (MS-DOS-style) window. 3. In the console window you have opened, navigate to the examples directory, and then to its SwingSet subdirectory. 4. From your console window, execute the runnit command: runnit 5. Read the README.txt file in the SwingSet directory for help using the SwingSet example. C. If you're running Windows 95: --------------------------------- 1. Open your favorite text editor and add the following environment-variable settings to your system's AUTOEXEC.BAT file: set JAVA_HOME=C:\JDK1.1.6 set SWING_HOME=C:\swing-1.1beta2 set CLASSPATH=.;%JAVA_HOME%\lib\classes.zip set PATH=%PATH%;%JAVA_HOME%\bin These settings assume that you have installed both the JDK and the Swing tool set on drive C. If either these toolkits has been installed on a different drive, substitute that drive's designator wherever it is appropriate. 2. Perform steps 2 through 5 of the instructions listed under the preceding heading, "If you're runnning Windows NT." 3. If you encounter an "Out of environment space" error, then you'll need to increase the size of the environment table. You can do this at the command line (which is temporary) or by editing a configuration file to make a permanent change (which requires restarting your computer). To temporarily increase environment space, enter the following at the DOS prompt: command /e:8192 To permanently increase environment space, add the following line to your CONFIG.SYS file and then restart your system: shell=command.com /e:8192 /p Once you've increased the size of the environment table, try running SwingSet again. ================================ Using Swing Components in an IDE ================================ To use Swing components in an IDE, such as Borland's JBuilder, Symantec's Cafe, Sun's JavaWorkshop, or IBM's VisualAge, you must import the swingall.jar file. The swingall.jar file includes the base Swing implementation, several looks and feels (Metal, Windows, and Motif), and information that make the Swing components work as beans. The swingall.jar file is necessary only if you plan to use Swing in one of the IDE environments, or if you would like to simply include one "all inclusive" jar file in your CLASSPATH or application. ======================================================= Compiling and Running Swing Applications without an IDE ======================================================= This section tells you how to compile and run your own programs. You don't need to read this section to be able to run the examples included in this release, since they all are pre-compiled and provide "runnit" or "runapplet" scripts. As long as you have your environment variables set as described previously in this file, you should be able to run the Swing examples. When you compile a Swing program, make sure that the swing.jar file is in the class path. If you use the "-classpath" compiler option, be sure to also specify the appropriate JDK classes.zip file and "." (or whatever directory the source code lives under). For example, on Solaris: /usr/local/java/jdk1.1.6/bin/javac -deprecation -classpath .:/usr/local/java/swing-1.1beta2/swing.jar:/usr/local/java/jdk1.1.6/lib/classes.zip MySwingProgram.java On Windows: C:\JDK1.1.6\bin\javac -deprecation -classpath .;C:\JDK1.1.6\lib\classes.zip;C:\swing-1.1beta2\swing.jar MySwingProgram.java When running a Swing application, make sure that the class path contains not only whatever you needed to compile the application, but also the JAR files for any platform-specific look and feel you're using. If you use only the Java look and feel (Metal), then you don't need an additional JAR file, since Metal is included in swing.jar. For example, on Solaris: /usr/local/java/jdk1.1.6/bin/java -classpath .:/usr/local/java/swing-1.1beta2/swing.jar:/usr/local/java/jdk1.1.6/lib/classes.zip MySwingProgram On Windows (with Windows look and feel): C:\JDK1.1.6\bin\java -classpath .;C:\JDK1.1.6\lib\classes.zip;C:\swing-1.1beta2\swing.jar;C:\swing-1.1beta2\windows.jar MySwingProgram ====================== What's In This Release ====================== This release contains the following: README.txt This file. README.html Links to interesting files (such as this one). LICENSE.txt Software license. CHANGES.txt Notes on changes since the previous release. src.zip Swing source code. doc/api/index.html Automatically generated Swing API documentation. doc/api/overview-summary.html No-frame version of the Swing API documentation. swing.jar The Swing classes. DO NOT UNARCHIVE THIS FILE! windows.jar The Windows look and feel. DO NOT UNARCHIVE! motif.jar The Motif look and feel. DO NOT UNARCHIVE! beaninfo.jar Beans-related files and classes. DO NOT UNARCHIVE! swingall.jar All of the above (useful for IDEs). DO NOT UNARCHIVE! multi.jar An experimental multiplexing look and feel. DO NOT UN- ARCHIVE! examples/SwingSet The comprehensive Swing example. examples/Simple A simple Swing application. examples/SwingApplet A simple Swing applet. examples/SampleTree An example using Swing tree features. examples/Stylepad An example using Swing text features. examples/Notepad Another text example. examples/DBDemos Files to set up databases for use with JDBC. examples/Table JTable/JDBC database connectivity examples. examples/Metalworks Demonstrates the Metal look and feel. examples/FileChooserDemo An example using JFileChooser. Have fun using Swing! --The Swing Team