import com.ibm.eNetwork.HOD.common.Environment; // Get the Environment class
import com.ibm.eNetwork.HOD.customizable.*; // Access to the API classes
import java.applet.*; // Get the Applet class
import java.awt.*; // Get the AWT classes
public class TermTest extends Applet {
CustomDesktop desktop;
public void init() {
super.init(); // Call init on the super class
setLayout(new BorderLayout());
Environment env = new Environment(this);
try {
HODSessionManager sm = new HODSessionManager();
desktop = sm.createCustomDesktop(env, "TermTest");
HODDisplaySession session = desktop.startDisplaySession("3270 Display");
add(BorderLayout.NORTH, session.getToolbar());
add(BorderLayout.CENTER, (Component)session.getTerminal());
validate();
} catch (Exception e) {
e.printStackTrace();
}
} // end init method
} // end TermTest class
The following explains each statement or group of statements used in the sample program:
import com.ibm.eNetwork.HOD.common.Environment; // Get the Environment class import com.ibm.eNetwork.HOD.customizable.*; // Access to the API classes import java.applet.*; // Get the Applet class import java.awt.*; // Get AWT classes
public class TermTest extends Applet {
public void init() {
super.init();
setLayout(new BorderLayout());
Environment env = new Environment(this);
try {
/*
* The name of the HTML file generated by the Deployment
* wizard is TermTest. HODData/TermTest exists on the Web server
* and contains the session definition files.
*/
HODSessionManager sm = new HODSessionManager();
CustomDesktop desktop = sm.createCustomDesktop(env, "TermTest");
HODDisplaySession session = desktop.startDisplaySession("3270 Display");
add(BorderLayout.NORTH, session.getToolbar());
add(BorderLayout.CENTER, (Component)session.getTerminal());
validate();
} catch (Exception e) {
e.printStackTrace();
}
Use the following simple HTML file to run the applet you created. The applet parameter ParameterFile must be present to use the API:
<HTML> <HEAD> <TITLE>First Programmable Host On-Demand Applet</TITLE> </HEAD> <BODY> <APPLET archive="habasen.jar,hodbasen.jar,hodapin.jar,ha3270n.jar,hodimg.jar,hacp.jar,ha_en.jar,customer.jar" CODE="TermTest.class" WIDTH=600 HEIGHT=700> <PARAM NAME="Cabinets" VALUE="habasen.cab,hodbasen.cab,hodapin.cab,ha3270n.cab,hodimg.cab,hacp.cab,ha_en.cab,customer.cab"> <PARAM NAME="ParameterFile" VALUE="HODData\\TermTest\\params.txt"> </APPLET> </BODY> </HTML>
To run TermTest, complete the following steps:
[ Top of Page | Previous Page | Next Page | Table of Contents ]