IBM Books

Screen Customizer Component Interface for Java


Screen Customizer Component Interface Applets

This section describes how to build a Java applet that uses the Screen Customizer Component Interface (SCCI). Also described in this section are the requirements for preparing and compiling the source code.

Source Code Preparation

Programs that use SCCI classes must import the appropriate SCCI packages to obtain class definitions and other compile-time information. The SCCI packages can be imported into a Java source file using the following statements:

import com.ibm.eNetwork.beans.HOD.*;                   // Hod classes and interfaces
import com.ibm.eNetwork.HOD.*;                         // Hod classes and interfaces

import com.ibm.hi.customizer.beans.scci.*;             // Base SCCI classes
import com.ibm.hi.customizer.beans.*;                  // Bean

To import the Custom listener interfaces and event classes (only needed when using Custom events):

import com.ibm.hi.customizer.beans.event.*;            // Custom Events & Listeners

Jar and Classpath Considerations

SCCI class files are located in the install_dir\toolkit\jars directory, where install_dir is the directory where you installed the Host Access Toolkit files. Both Java 1 and Java 2 environments are supported.  Java archive (JAR) files for the Java 1 and Java 2 environments are located in the following directories: 

where install_dir is the directory into which the Toolkit files are installed (by default, C:\Program Files\IBM\Host Access Toolkit). The following  files contain full Screen Customizer support (except for a few noted exceptions):

File Names Description
scbeans.jar (Java 1) and scbeans2.jar (Java 2) Supports Screen Customizer functionality (Screen Customizer bean and SCCI classes) in the English language
scbeansnlv.jar (Java 1) and scbeansnlv2.jar (Java 2) Supports Screen Customizer functionality in English plus the other national languages that Screen Customizer is translated into
habeans.jar (Java 1) and habeans2.jar (Java 2) Supports Host Access Beans functionality (base Host Access Bean classes) in the English language
habeansnlv.jar (Java 1) and habeansnlv2.jar (Java 2) Supports Host Access Beans functionality in English plus the other national languages that Host Access Beans are translated into

To successfully compile and run your application, the CLASSPATH environment variable must be updated to include the jar files needed by your application. You can also set the classpath using the Java compiler's '-classpath' parameter when compiling your application.

To find the SCCI and HACL classes in the jar files, the CLASSPATH variable (or -classpath parameter) must point directly to the jar files. For example, if the jar files are located in the c:\jars directory, the CLASSPATH should look like this (do not forget to include the base java classes, assume they are in c:\jdk\lib\classes.zip):

CLASSPATH=.;c:\jdk\lib\classes.zip;c:\jars\scbeans.jar;c:\jars\habeans.jar;

Compiling

The following example assumes that the JDK is installed in the c:\jdk directory, Host On Demand is installed in c:\hostondemand, the necessary ScreenCustomizer and HOD jar files are in the default locations at C:\Program Files\IBM\Host Access Toolkit\toolkit\, and HelloWorld is saved as c:\hostondemand\hod\HelloWorld.java.   One of the following sets of commands needs to be executed at the command prompt:

c:\hostondemand\hod> set CLASSPATH=.;c:\jdk\lib\classes.zip;c:\Program Files\IBM\Host Access Toolkit\toolkit\jars\debug\scbeans.jar;
                                   c:\Program Files\IBM\Host Access Toolkit\toolkit\jars\debug\habeans.jar;
c:\hostondemand\hod> c:\jdk\bin\javac HelloWorld.java

or:

c:\hostondemand\hod> c:\jdk\bin\javac -classpath
                                .;c:\jdk\lib\classes.zip;c:\Program Files\IBM\Host Access Toolkit\toolkit\jars\debug\scbeans.jar;
                                c:\Program Files\IBM\Host Access Toolkit\toolkit\habeans.jar; HelloWorld.java

Executing

Screen Customizer provides the ability to load and run user-defined applets. A user applet can be launched from the 'Run Applet' dialog or as a 'Startup Applet'. The 'Run Applet' dialog can be displayed from either the button bar or the 'Assist' pull-down menu. The dialog prompts for the name of a user-defined class (without the .class extension), constructs an instance of the class using the default constructor, and gives the class access to the current session. The 'Startup Applet' can be specified in the session configuration window on the Advanced tab. In the Screen Customizer Studio you can also invoke the run applet command as part of a macro on a button, or with Get-to-the-Point.


[ Top of Page | Previous Page | Next Page | Table of Contents]