
[ Previous ] [ Index ] [ Next ]


When you copy the applet java file, we suggest you change the name of the applet class (perhaps by adding
"Hab" as a prefix) to avoid class name confusion. Your original applet
file remains unchanged so that you can still run it as a single-user applet.
| Running Example from the example of habanerizing TextDemo.java. |
| To start the Running Example, create a subdirectory of apps
called TextDemo. Copy TextDemo.java
there and rename it HabTextDemo.java. Then put at the top of the
file:
package TextDemo; |
import java.awt.*; import java.awt.event.*; import java.applet.*;you need also to:
import ncsa.habanero.*; import ncsa.habanero.streams.*; import java.io.IOException;
| Running Example from the example of habanerizing TextDemo.java. |
Just add to the imports:
import ncsa.habanero.*; import ncsa.habanero.streams.*; import java.io.IOException; |
| Running Example from the example of habanerizing TextDemo.java. |
| public class HabTextDemo extends Hablet |
|
|
If you are converting an applet into a hablet, you always have to change the superclass as indicated above. Applets have a lot of data, such as window information, that you do not want to be transferred to other running copies. Hence when you subclass from Hablet instead, we prevent that information from being copied. If you are not starting from an applet -- for example, if you start from an application -- you will not have to do this. |
Habanero® is a registered trademark owned by The Board of Trustees of the University of Illinois. Copyright 1996-1998. All rights reserved. Java(TM) is a proprietary trademark owned by Sun Microsystems, Inc.
![]()
The National Center for Supercomputing Applications
University of Illinois at Urbana-Champaign
Contacts page