Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


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

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


Applets

What is a Java Applet?

Java is an object-oriented programming language developed by Sun Microsystems. One of the greatest things about the fact that Java is object oriented is the standard library of objects it provides. These objects are easy to use and rich with functionality. A Java program is executed as either an application which runs stand-alone from the command line or as an applet that runs under a Web browser. Applications and applets start program execution in different ways; an application has a main() method and an applet has a init() method inititiated by the browser. This article will focus on writing an applet.

How do you execute a Java Applet?

The source code of a Java applet is stored in file with the suffix ".java". The source code is compiled into bytecode and stored in a file with the suffix ".class". The ".class" file is included in the HTML document using the applet tag. Here is an example of the applet tag used by the Contact applet:

<APPLET CODE="Contact.class" WIDTH=170 HEIGHT=150>

A Java applet is executed by a Web browser when the browser loads an HTML document that contains an applet tag. The Contact applet source code is stored in Contact.java. Its bytecode is stored in Contact.class . It is included in the Contact.html document. The applet tag defines the width and height of the applet window within the HTML document. The applet tag has numerous attributes to enhance its placement within the HTML document.

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, & Permissions, Privacy Policy.

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