Use the following as an example for your program.
////////////////////////////////////////////////////////////////////////////////// // // Example using the IBM Toolbox for Java's vaccess // class, VJobList. // // This source is an example of IBM Toolbox for Java "Job List". // ////////////////////////////////////////////////////////////////////////////////// package examples; Note 1 import com.ibm.as400.access.*; import com.ibm.as400.vaccess.*; Note 2 import javax.swing.*; Note 3 import java.awt.*; import java.awt.event.*; public class GUIExample { public static void main(String[] parameters) Note 4 { GUIExample example = new GUIExample(parameters); } public GUIExample(String[] parameters) { try Note 5 { // Create an AS400 object. //The system name was passed as the first command line argument. AS400 system = new AS400 (parameters[0]); Note 6 VJobList jobList = new VJobList (system); Note 7 // Create a frame. JFrame frame = new JFrame ("Job List Example"); Note 8 // Create an error dialog adapter. This will display any errors to the user. ErrorDialogAdapter errorHandler = new ErrorDialogAdapter (frame); Note 9 // Create an explorer pane to present the job list. AS400ExplorerPane explorerPane = new AS400ExplorerPane (jobList); Note 10 explorerPane.addErrorListener (errorHandler); Note 11 // Use load to load the information from the system. explorerPane.load(); Note 12 // When the frame closes, exit the program. frame.addWindowListener (new WindowAdapter () Note 13 { public void windowClosing (WindowEvent event) { System.exit(0); } } ); // Layout the frame with the explorer pane. frame.getContentPane().setLayout(new BorderLayout() ); frame.getContentPane().add("Center", explorerPane); Note 14 frame.pack(); frame.show(); Note 15 } catch (Exception e) { e.printStackTrace(); Note 16 } System.exit(0); Note 17 } }