Prerequisites
-
A platform that supports Netscape Communicator 4.0
Skeleton Code
In this magercise, you will learn how to use Netscape's Capabilities API to access hosts anywhere on the network and to create
Dialog
boxes without the applet warning message line. The program counts the words for the contents of a URL you provide and
displays the word count. If a bad URL string is entered, the message dialog appears. While counting, the program changes the cursor to an
hourglass.
See the Netscape Capabilities Classes course section for additional information.
Perform the following tasks:
Import Netscape's security package to provide access to the capabilities API.
At the beginning of the block of code that does the word counting, in the getCount
method of the skeleton code, enable the
appropriate privilege for accessing any network connection.
At the end of the block of code, disable the same privilege.
In the popupMessage
method, enable the appropriate privilege for disabling the applet warning message for dialogs.
After the source code for creating the dialog, disable the privilege.
Add Netscape's
capabilities classes to your CLASSPATH
.
Compile the program.
Create an HTML loader for the applet.
Load program into Communicator and try it out.
The task numbers above are linked to the
step-by-step help page. Also available
is a complete solution to the
problem, and a demonstration
of the expected behavior.
Copyright © 1998 MageLang Institute.
All Rights Reserved.