× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: AWT on AS400 Missing?
  • From: Don Strickland <dstrickland@xxxxxxx>
  • Date: Fri, 19 May 2000 13:12:03 -0700


I am attempting to run a Java program that extends Frame.  It works on
Visual Age, but I get the following error when I run it on the AS400.
Anyone know why?  The error is:
        java.awt.AWTError: Toolkit not found: com.ibm.rawt.client.CToolkit

              java/awt/Toolkit.getDefaultToolkit()Ljava/awt/Toolkit;+51
(Toolkit.java:396)           
              java/awt/Frame.addNotify()V+14 (Frame.java:203)

              java/awt/Window.pack()V+27 (Window.java:123)

              testFrame.<init>()V+151 (testFrame.java:30)

              testFrame.main([Ljava/lang/String;)V+1 (testFrame.java:36)

        $


It seems to be loading AWT properly.  I used -verbose to display the
following loaded objects:
        Loading class java/awt/Frame.class from
/QIBM/ProdData/Java400/jdk117/lib/classes.zip                      
        Loading class java/awt/Window.class from
/QIBM/ProdData/Java400/jdk117/lib/classes.zip                     
        Loading class java/awt/Container.class from
/QIBM/ProdData/Java400/jdk117/lib/classes.zip                  
        Loading class java/awt/Component.class from
/QIBM/ProdData/Java400/jdk117/lib/classes.zip                  
        Loading class java/awt/image/ImageObserver.class from
/QIBM/ProdData/Java400/jdk117/lib/classes.zip        

Note:  this is a subset...there a hundred or so.

My export in .profile is:
        export -s
CLASSPATH=.:$HOME/AS400JT/lib/jt400.zip:$HOME/AS400JT/utilities


The source is:
        import java.awt.*;
        import java.awt.event.*;
        class testFrame extends Frame
        {
                private Label instructions;
                private Label prompt;
                private TextField entry;
                private Button listButton;
                private Button okButton;
                public testFrame() 
                {
                        super();
                        setTitle("My First Java Window");
                        setSize(300,200);
                        setLocation(200,100);
                        setBackground(java.awt.Color.lightGray);

                        instructions= new Label("Enter Company Number");
                        prompt  = new Label("Number");
                        entry= new TextField(5);
                        listButton= new Button("List...");
                        okButton= new Button("Ok");
                        
                        setLayout(new BorderLayout());
                        add(instructions,"North");
                        add(entry,"South");
                        add(listButton,"East");         
                        add(okButton,"West");
                        
                        pack();
                        show();
                }
                public static void main(String args[])
                {
                        testFrame test = new testFrame();
                }
        }

























Don Strickland
Senior Programmer/Analyst
dstrickland@800.COM
(503) 944-3631


+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.