Sun Java Solaris Communities My SDN Account Join SDN
 
Tutorials & Code Camps

Using Netscape's Capabilities Classes

 
Training Index


Help | Solution | API Docs | Expected Output
Course Notes | Magercises | Module Intro

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:

  1. Import Netscape's security package to provide access to the capabilities API.

  2. 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.

  3. At the end of the block of code, disable the same privilege.

  4. In the popupMessage method, enable the appropriate privilege for disabling the applet warning message for dialogs.

  5. After the source code for creating the dialog, disable the privilege.

  6. Add Netscape's capabilities classes to your CLASSPATH.

  7. Compile the program.

  8. Create an HTML loader for the applet.

  9. 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.