JClass BWT Overview

Introduction · Setting CLASSPATH

Compiling a Program · Using HTML Files to Set Properties

Distributing JClass BWT Applications


Introduction

Sun Microsystems' Java Development Toolkit (JDK) comes with a number of prefabricated components 1, such as clickable buttons, scrollbars, checkboxes, pop-up menus for use in the construction of Graphical User Interfaces (GUIs) for Java programs. The part of the JDK that contains all of the classes and objects used in making GUIs is called the Abstract Window Toolkit, better known simply as AWT. JClass BWT provides new or improved GUI components that can be used in Java programs along with or instead of their AWT equivalents.

The AWT consists of a number of components, layout managers and containers for constructing Java GUIs. Components consist of the individual "parts" a user interacts with, such as text boxes and buttons. Layout managers are objects used to position and arrange individual components within a Java GUI. Containers are themselves components (derived from java.awt.Component) which "hold" both the layout managers and the components; their sole purpose is to keep track of the components contained within them. For Java GUIs, each container has an associated layout manager, which passes along information on the positioning of each of that container's subcomponents. The layout manager in turn controls where individual components appear. The individual GUI components are part of a set of control classes with which the user can interact to perform useful functions.

JClass BWT provides new or improved versions of various AWT components and containers. JClass BWT provides the following features:

Many of these are designed to replace their AWT counterparts, providing improved functionality. In many cases it is possible to simply swap the names of current AWT components (for example: Scrollbar) in your current Java applications with their BWT equivalents (JCScrollbar). BWT containers like JCOutliner (which provides a means of organizing hierarchically- organized data) provide new ways of arranging information is displayed in the GUI of your Java programs.

Conceptually, JClass BWT adds new or improved containers and components to Java. The goal of BWT is to reduce the complexity of development and provide the Java developer with the improved Java components and containers needed to get Java programming projects done as quickly and efficiently as possible.


Setting CLASSPATH

Before beginning to use JClass BWT, you need to set up the CLASSPATH environment variable to point to the jcbwt{xxx}-classes.zip file ({xxx} is the JClass BWT version number). The CLASSPATH environment variable consists of the names of directories containing compiled Java classes. The examples in this section will help you set CLASSPATH properly on your system.

Note: If you installed the EXE distribution of JClass BWT, CLASSPATH may have been set up automatically.

If you are using JClass BWT in a development environment, do not extract (unarchive) the contents of the classes ZIP file because Java can automatically read the contents of this file. If you are using JClass BWT in a server-based environment, however, you must extract (unarchive) the classes ZIP file so that the server can access the individual class files. You can extract the files into a single directory using PKZIP 2.04g or a compatible de-archiving tool.

If your CLASSPATH environment variable is not set up correctly, see your system administrator or the documentation on updating environment variables for your computing platform. This information can be found through the Java Development Kit Web page at http://www.javasoft.com/products/jdk/.

Before attempting to use JClass BWT, you must be able to compile Java applications or applets. Make sure you can compile and run simple Java applications or applets before you begin to use JClass BWT. Consult the Java JDK documentation for assistance in determining the location of the Java compiler (javac) and the Java class files.

The following describes how to configure the CLASSPATH for specific operating systems:

Windows 95

Add a line to your AUTOEXEC.BAT file that points to the directory where the classes ZIP file is installed. If it is installed in a directory called \foo, you would add something similar to the following to EM CLASS="Emphasis">AUTOEXEC.BAT (replace {xxx} with the JClass BWT version number):

     set CLASSPATH={references to other programs};C:\foo\jcbwt{xxx}-classes.zip

Windows NT (3.51 and higher)

Assuming that the classes ZIP file is installed in a directory called \foo, add the CLASSPATH statement to a Windows NT system by doing the following:

  1. Double click Control Panel. The Control Panel window opens.
  2. If you are using Windows NT 3.51, Double click System. The System dialog is displayed. If you are using Windows NT 4.0, double click System. The System Properties dialog appears. Click Environment.
  3. Search the User Environment Variables (or User Variables in Windows NT 4.0) list for an existing CLASSPATH statement.
  4. If a CLASSPATH statement exists, select it. In the Value field, add the following to the existing statement (replace {xxx} with the JClass BWT version number):

                  C:\foo\jcbwt{xxx}-classes.zip
    
    If no CLASSPATH statement exists, in the Variable field, type:
                  CLASSPATH
    
    and in the Value field, type:
                  C:\foo\jcbwt{xxx}-classes.zip
    
  5. Click OK.
  6. Tip: If you are going to compile Java programs in the same directory that contains Java .class files, add a period to the CLASSPATH statement to tell the Java compiler to look for .class files in the current directory, as in the following example:

    	C:\foo\jcbwt{xxx}-classes.zip;.
    

    This method will work on all computing platforms.

    Note:
    If you have a previously-installed version of JClass BWT, remove it and references to it from your CLASSPATH.


Compiling a Program

Before attempting to use JClass BWT, you must be able to compile Java applications or applets. Make sure you can compile and run simple Java applications or applets before you begin to use JClass BWT. Consult the Java JDK documentation for assistance in determining the location of the Java compiler (javac) and the Java class files.

Java allows for two distinct program types: stand-alone applications and applets. Stand-alone applications can be run directly on a system containing the Java interpreter program ( java ), while applets can be inserted and run from Web pages when viewed through a Java-capable browser. JClass components can be used with both types of Java programs. Ensure you can compile and run simple Java applications or applets before you begin to use JClass BWT. Consult the Java JDK documentation for assistance in determining the location of the Java compiler ( javac ) and the Java .class files.


Using HTML Files to Set Properties

In some cases it is better to set the values of properties of a Java program with an HTML file instead of using values "hard-coded" into the program. JClass products introduced the idea of "resources " (now better known as "properties" in Java Beans parlance), which enable programmers to set certain display and functional parameters for a Java applet from within an HTML file. This approach offers the following benefits:

The property mechanism allows the user to read component parameters from within an HTML file. The mechanism is not hierarchical; instead it is tag-based. An applet is constructed incorporating JClass BWT components that contain property settings. The compiled applet obtains its operating parameters from the NAME and VALUE elements of the <PARAM> tag in an HTML file. Many JClass BWT properties can be set within HTML files in this manner. Properties that cannot be set using a property are generally too complex or obscure for end-users to want direct control over them.

HTML files for all the components in an application can also be combined to create an application default file.


Distributing JClass BWT Applications

You can freely distribute end-user Java applications or applets you build with JClass BWT components under certain restrictions.

For more information, read the License Agreement at the beginning of this manual for complete details.


1

The various parts of the Component class have been called "controls" and "widgets" by various sources. The term "control" is Windows terminology, while "widgets" is derived from Unix Motif/X-Windows. This manual follows Windows terminology as much as possible in describing Java components and methods.