× 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.



Excerpts from java400-l: 26-May'00 Calling a Frame in java/400 v.
purushothaman@hotmail (1173*) 

> Hai, 
>            I have a simple java program which is calling a frame. I also  
> have jt400.zip in my classpath. The program compiling well, but when i try  
> to run the program it is giving the following errors. If anyone knows the  
> solution, pls let me know, i will be very thankful. 

This is a sort of "long-winded" answer, but that's never stopped me
before.  :) 

Since the AS/400 has no native GUI, the use of AWT components in a Java
application on the AS/400 is problematic. 

There are a few possible routes we could have taken: 
    Architect and add a native GUI to the AS/400. 
    Disallow graphics-based Java applications on the AS/400. 
    Require the use of a "cooperating" GUI-capable machine to use Java
    graphics on the AS/400. 

The first choice was overwhelming, the second choice was non-compliant,
so that left option 3.  So, to do graphics-based Java apps on the AS/400
it is necessary to employ a separate machine -- one which does have a
native GUI -- to serve the AS/400's graphics requirements. 

This is accomplished using something called "Remote-AWT" or "RAWT". 
RAWT provides a sockets-based connection between the AS/400
("application host") and the GUI machine.  The application host then
includes code that "intercepts" AWT calls, and routes them to the GUI
machine for actual display processing.  (This is an over-simplification,
but the details are beyond the scope of this post.) 

So, there are two "sides" to RAWT -- one piece of code on the
application host and one piece, on the GUI machine.  RAWT is written in
Java, so any GUI machine with a fully-functional AWT implementation can
serve up the RAWT "glass," (though NT is the most widely used and
"tuned.") 

To use RAWT, you first need to download the appropriate GUI code to the
GUI machine, and start the GUI "daemon" process, which listens for
connections from an application host.  Once this daemon is running, the
application host can then start processing.  Of course, the application
host must be made aware of the name or IP address of the GUI machine, in
order to establish its connection. 

There are two "properties" that must be specified to AS/400 Java to use RAWT:  
        RmtAwtServer=<name_or_IP_address>  
        os400.class.path.rawt=1 

The first property specifies the name or address of the machine running
the RAWT GUI daemon, and the second property tell the JVM to put the
RAWT application host code into the Java CLASSPATH. 

A word of warning is in order.  RAWT was designed originally to satisfy
the Sun requirements for compliance -- we could not have shipped Java on
the AS/400 without RAWT.  As such, function was the primary concern (and
no mean feat, I assure you.)  However, performance of a "heavy-weight"
GUI, with lots of buttons and whistles and dragging and entering and
drawing, can politely be called "lackluster," especially in the early
releases. 

With JDK 1.2, RAWT's internals were redesigned, and some remarkable
performance improvements have been realized, but there is still a long
way to go.  However, the performance of RAWT is never expected to match
that of the same application using a "native" GUI, though that is
obviously a desirable goal, and one we'll aspire to. 

So, the bottom line is that using a GUI with an AS/400 application
requires another machine to serve the GUI processing, even in cases
where the Component is never realized on any "glass."  This does pose
some difficult questions for applications such as servlets that just
want to use the immediate model to create a graph to be shipped in a
web-page...  Why do they need a separate machine, if there's no absolute
requirement for "glass?"  The answer is deep in the RAWT, but the
concern is certainly being actively considered at this end, I can tell
you. 

Finally, for more information, please visit the "Running on a host
without a GUI" link from
http://publib.boulder.ibm.com/pubs/html/as400/v4r4/ic2924/info/java/rzaha
/devkit.htm -- it will recap what I've told you, and get down to the
nitty-gritty of how to actually use RAWT. 

HTH. 

-blair 

  ___   _           Blair Wyman                  IBM Rochester 
 ( /_)  /  _  ' _   (507)253-2891            blairw@us.ibm.com 
__/__)_/_<_/_/_/_'  Opinions expressed may not be those of IBM 

+---
| 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 ...

Replies:

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.