
[ Previous ] [ Index ] [ Next ]


In Habanero, there is no HTML page. Instead, the hablet runs in its own window. Thus it needs to have a method that tells it window size and other details.
Things included in the body of startInFrame(MirrorFrame):
| Running Example from the example of habanerizing TextDemo.java. |
Add or modify this method in the class HabTextDemo:
public void startInFrame(MirrorFrame f)
{
f.setTitle("Habanerized TextDemo");
f.add("Center", this); // Center hablet in window
f.setSize(500,200); // Window's size
f.setVisible(true); // Window initially visible
f.show(); // Show the window
init(); // Initialize hablet code
start(); // Start hablet running
// Code for event handling goes here.
}
|
|
|
If you need to post an event from within StartInFrame(), you must post it from a new thread, or it will deadlock. |
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