All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.vaccess.VJavaApplicationCall

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----com.ibm.as400.vaccess.VJavaApplicationCall

public class VJavaApplicationCall
extends JComponent
implements KeyListener

The VJavaApplicationCall class provides a visual interface to com.ibm.as400.access.JavaApplicationCall. The visual interface consists of two components: an input field where the program to run is specified and input is sent to the program, and an output text area where the output from the program is displayed.

GUI output generated by the Java program running on the AS/400 is not handled by this class. As in JavaApplicationCall, the Java program running on the AS/400 receives input via standard. The output text area displays output the AS/400 java program writes to standard out and standard error. GUI input/output must be handled via another mechanism such as Remote AWT.

There are two ways to set up the AS/400 Java environment:

  1. VJavaApplicationCall must have a JavaApplicationCall object. After creating the JavaApplicationCall object, the application can set environment parameters on the JavaApplicationCall, object, then construct the VJavaApplicationCall object passing it the JavaApplicationCall object. The advantage to this method is the application sets up the environment instead of the user.
  2. The environment can be set up via set commands entered in the GUI. For additional information on these commands, see the on-line help for the Java command. Valid commands are: For example, to send the optimization level to 30, enter

You start the Java application using the java command. The syntax for this command is much like the syntax when running the command on the client. It is

Note, this class correctly sets the standard in, standard out and standard error properties so os400.stdin, os400.stdout or os400stderr properties are ignored. For example, to run Java application To use this class you simply create a frame to contain the class then call the load() method to run the start the application. For example,
AS400 system = new AS400("myAS400");
 JavaApplicationCall javaCall  = new  JavaApplicationCall(system);
VJavaApplicationCall vJavaCall = new VJavaApplicationCall(javaCall);
JFrame f = new JFrame ("JavaApplicationCallExample");
f.getContentPane().setLayout(new BorderLayout ());
f.getContentPane().add("Center", vJavaCall);
f.pack();
f.show();


Constructor Index

 o VJavaApplicationCall()
Constructs a VJavaApplicationCall object.
 o VJavaApplicationCall(JavaApplicationCall)
Constructs a VJavaApplicationCall object.

Method Index

 o addErrorListener(ErrorListener)
Adds a listener to be notified when an error occurs.
 o addNotify()
Notification to VJavaApplicationCall that it now has a parent component.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener to be notified when the value of any bound property changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener to be notified when the value of any constrained property changes.
 o addWorkingListener(WorkingListener)
Adds a listener to be notified when work starts and stops on potentially long running operations.
 o finalize()
Stops all threads.
 o getJavaApplicationCall()
Returns the access class which defines the Java application to run.
 o getOutputText()
Returns a reference to the JTextArea object.
 o keyPressed(KeyEvent)
A key is pressed.
 o keyReleased(KeyEvent)
The key is released.
 o keyTyped(KeyEvent)
The key is typed.
 o removeErrorListener(ErrorListener)
Removes an error listener.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a property change listener.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable change listener.
 o removeWorkingListener(WorkingListener)
Removes a working listener.
 o setJavaApplicationCall(JavaApplicationCall)
Sets the JavaApplicationCall object.

Constructors

 o VJavaApplicationCall
 public VJavaApplicationCall()
Constructs a VJavaApplicationCall object.

 o VJavaApplicationCall
 public VJavaApplicationCall(JavaApplicationCall javaApplicationCall)
Constructs a VJavaApplicationCall object. A JavaApplicationCall object defines the Java program to run.

Parameters:
javaApplicationCall - The access class which defines the Java application to run.

Methods

 o addErrorListener
 public void addErrorListener(ErrorListener listener)
Adds a listener to be notified when an error occurs.

Parameters:
listener - The listener.
See Also:
removeErrorListener
 o addNotify
 public void addNotify()
Notification to VJavaApplicationCall that it now has a parent component. The windowing system calls this method when VJavaApplicationCall gets a parent frame. When called VJavaApplicationCall requsts input focus be given to the input field.

Since this method is called by Swing at the appropriate time, application code should not call this method.

Overrides:
addNotify in class JComponent
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes.

Parameters:
listener - The listener.
Overrides:
addPropertyChangeListener in class JComponent
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes.

Parameters:
listener - The listener.
Overrides:
addVetoableChangeListener in class JComponent
See Also:
removeVetoableChangeListener
 o addWorkingListener
 public void addWorkingListener(WorkingListener listener)
Adds a listener to be notified when work starts and stops on potentially long running operations.

Parameters:
listener - The listener.
 o finalize
 protected void finalize() throws Throwable
Stops all threads.

Throws: Throwable
If an error occurs during cleanup.
Overrides:
finalize in class Object
 o getJavaApplicationCall
 public JavaApplicationCall getJavaApplicationCall()
Returns the access class which defines the Java application to run.

Returns:
The the com.ibm.as400.access.JavaApplicationCall object which defines the Java application to run.
 o getOutputText
 public JTextArea getOutputText()
Returns a reference to the JTextArea object. Standard output and standard error information from the AS/400 Java program are displayed in this text area. The application can use the reference to the JTextArea to modify attributes such as the size of the text area or the font used to display text in the text area.

Returns:
The JTextArea object which displays standard output and standard error from the AS/400 Java program.
 o keyPressed
 public void keyPressed(KeyEvent keyEvent)
A key is pressed.

Parameters:
keyEvent - The key event.
 o keyReleased
 public void keyReleased(KeyEvent keyEvent)
The key is released.

Parameters:
keyEvent - The key event.
 o keyTyped
 public void keyTyped(KeyEvent keyEvent)
The key is typed.

Parameters:
keyEvent - The key event.
 o removeErrorListener
 public void removeErrorListener(ErrorListener listener)
Removes an error listener.

Parameters:
listener - The listener.
See Also:
addErrorListener
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.

Parameters:
listener - The listener.
Overrides:
removePropertyChangeListener in class JComponent
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable change listener.

Parameters:
listener - The listener.
Overrides:
removeVetoableChangeListener in class JComponent
See Also:
addVetoableChangeListener
 o removeWorkingListener
 public void removeWorkingListener(WorkingListener listener)
Removes a working listener.

Parameters:
listener - The listener.
 o setJavaApplicationCall
 public void setJavaApplicationCall(JavaApplicationCall javaApplicationCall) throws PropertyVetoException
Sets the JavaApplicationCall object.

Parameters:
javaApplicationCall - A com.ibm.as400.access.JavaApplicationCall object which defines the Java application to call.
Throws: PropertyVetoException
If the change is voted.

All Packages  Class Hierarchy  This Package  Previous  Next  Index