TransJam Collaboration ServerTransJam Client Programming Tutorial
|
We can use a special class called AppletTester that is part of the "com.transjam.awt" package. This package contains a set of AWT based GUI tools for use with the Transjam server. The AppletTester simulates the web browser environment and calls our Applet just like a web browser. It creates a Frame and places the Applet in the center of the frame. Then it calls the Applet's init() and start() methods. When the frame is closed, the Applet's stop() and destroy() methods are called.
In order to run an application from an IDE, we must provide a main() method. In the main method we instantiate one of our Applet objects. Then we pass it to a static method of the AppletTester.
/** Define main() so that we can test this Applet like a regular application. * Then we can debug it using an IDE instead of a browser. */ public static void main( String argv[] ) { // Create one of these objects. Chatter applet = new Chatter(); // Test the applet using this browser simulator. AppletTester.test( applet, 500, 400 ); }[Previous] [Top] [Next]
(C) 2002 SoftSynth.com