# 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 Windowing 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:

- written entirely in Java
- components and containers that are easier-to-use and offer more features than their AWT equivalents
- a uniform MS-Windows 95 "look-and-feel" across all platforms
- consistent operation across platforms
- ability to create Applets incorporating JClass BWT components whose parameters can be set from either HTML or comma-delimited files
- GUI components are double-buffered, providing faster on-screen redraws
- callbacks and extra methods reduces the need to subclass a component to obtain extra functionality, saving time and reducing the complexity of Java programs
- unlike AWT components, BWT components are easily subclassed
- provision for callbacks and event tracking enables Java programs to easily notify and interact with BWT components
- better keyboard traversal and focus management.

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

The is installed. If jcbwt.zip is installed in a directory called \foo, you would add something similar to the following to your AUTOEXEC.BAT file:

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

#### Windows NT (3.51 and higher)

Assuming that jcbwt.zip 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.

If a CLASSPATH statement exists, select it. In the Value field, add the following to the existing statement:

                  C:\foo\jcbwt200T-classes.zip

If no CLASSPATH statement exists, in the Variable field, type:

                  CLASSPATH

and in the Value field, type:

                  C:\foo\jcbwt200T-classes.zip

4. Click OK.

Note: 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 point the Java compiler to look for .class files in the current directory, as in the following example:

C:\foo\jcbwt200T-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.

Note to Symantec Cafe Users:
The version of the JDK that comes with Symantec Cafe 1.2 or later does not use the CLASSPATH variable. Instead, it uses a CLASSPATH resource contained in an .ini file in the Cafe hierarchy.

Please refer to the README file that comes with Symantec Cafe for more details.

##

Compiling a Program

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:

- Speed -- changes can be seen immediately, instead of having to be compiled.
- Flexibility -- you can allow end-users to modify some property values to suit their own needs.

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 too 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.