Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Structure

What is the structure of an applet program?

An applet consists of the import statements, class statement, member variable declarations and the class methods. Using the Contact class we will learn about each of these components. To easily follow this discussion you may want to print the Contact applet's source code. The first four statements in the Contact applet are the import statements, which reference Java packages and classes that are used by the Contact applet.

import statements

import java.awt.*; This is a package of classes for building a graphical user interface.

import java.applet.*; This is a package of classes including the Applet class that the Contact class is extending.

import java.util.StringTokenizer; This is a class that provides string parsing capabilities.

import java.net.URL; This class is used to invoke the client browser's Email program.

class statement

public class Contact extends Applet {

This class statement defines the Contact class as a public subclass of the Applet class. The keyword class is the statement identifier. Contact is the name of this new class. The keyword extends causes the new class Contact to be created as a copy of the class Applet. This creation process is referred to as "extending a class" and as "subclassing a class".

All applets must be a subclass of the Applet class. A subclass is just a way of using the code already available for a class and adding more code to it. When a class is extended from another class it inherits all data and methods of the class it extends. The modifier public indicates that the Contact class can be extended. To prevent a class from being subclassed the modifier would be final instead of public.

The Applet class is itself a subclass of the Panel class. The Panel class is a subclass of another class, and so on. Here is the hierarchy of the Applet class.

Previous Next



Up to => Home / Authoring / Java / Intro




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers