Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 

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.

[ This page was updated: 16-Nov-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.