home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 July & August
/
Pcwk78a98.iso
/
Micrsoft
/
VJ
/
VJ98
/
VJPROJS
/
WEBPAGES
/
CODEHTM
/
CODEHTM.JAV
< prev
next >
Wrap
Text File
|
1998-02-11
|
1KB
|
50 lines
// Class1.java
import wfc.html.*;
/**
* This class is hosted on an HTML page as a COM object.
* Program execution begins with the documentLoad() method.
* When the HTML document has loaded, this method is envoked.
*/
public class Class1 extends DhModule
{
DhDocument dhdoc;
/**
* The main entry point for the program.
*
* @param sender The Object that initiated the call to this method
* @param event The DhEvent that the sender generated
*/
public void documentLoad(Object sender, DhEvent event)
{
initForm();
}
/**
* Connects to the HTML document and manipulates elements on the
* page.
*/
void initForm()
{
dhdoc = getDocument();
dhdoc.add(new DhText("Class1"));
// TODO: Add additional initialization code here
/**
* New controls can be added to the page dynamically from code:
* DhButton button1 = new DhButton("button1");
* dhdoc.add(button);
* Existing HTML elements can be manipulated, too:
* DhButton button2 = (DhButton) dhdoc.findElement("button2");
* button2.setText("New caption");
* This method assumes that the "button2" element already exists
* in Page1.htm:
* <INPUT TYPE=BUTTON ID="button2" VALUE="Old caption">
*/
}
}