Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

Java Tutorial
Java Introduction
Object Oriented Programming Concepts
Anatomy of a Java Application
Syntax and Semantics of Java
Java Objects, Classes, and Interfaces
The String and StringBuffer Classes in Java
Setting Program Attributes in Java
Using System Resources in Java
Threads of Control in Java
Errors and Exceptions in Java
Java Input and Output Streams
Overview of Java Applet
Creating an Applet User Interface in Java
Communicating with Other Programs in Java
Overview of the Java UI
Using GUI Building Blocks in Java
Laying Out Components within a Container
Working with Graphics in Java
How Java Differs from C and C++
Java Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Overview of Java Applet

Previous Next



Most common Java programs are the applications and applets. Applications are the stand-alone programs, like HotJava browser. Applets are similar to the applications, but they will not run on their own. Instead they adhere to a set of conventions which lets them run within the Java-compatible browser.




The Life Cycle of the Applet

Loading an Applet
When an applet is been loaded, this is what happens:

  • An instance of applet's controlling class is created.
  • The applet gets initialized itself.
  • The applet starts to run.

Leaving and Returning to Applet's Page
When user leaves the page -- say for example, to go to different page -- the applet has an option to stop by itself. When the user returns to the page, applet can do start by itself again. The same thing takes place when the user iconifies a browser window which contains the applet.

Reloading the Applet
Some browsers let the users to reload the applets, which consists of unloading applet and then loading it again. Before an applet is been unloaded, it is given the chance to stop itself and then perform the final cleanup, so that the applet can do release any of the resources it holds. After that the applet is unloaded and loaded as described in Loading the Applet, above.




Role of Threads in Applets

Every applet can do run in multiple threads. example: when a HotJava browser first views the document that contains an applet, browser's DocumentSwitcher thread executes an applet's init() method. And when user scrolls the document, AWT WServer thread executes an applet's update() method.

So why would a applet need to create and use its own threads? Imagine an applet that performs the time-consuming initialization -- like loading images -- in its init() method. The thread which invokes the init() method cannot do anything else until the init() returns. In the HotJava browser, this means that browser cannot display applet or anything after it until the applet has finished the initializing itself. Therefoer if an applet is at the top of the page, then nothing would appear on the page until the applet has finished initializing itself.

The solution to this is to create a thread and move the initialization code from the init() method into thread body.




What the Applets Can and Can't Do

The Security Restrictions
For the security reasons, an applet which is loaded over network has the following restrictions:

  • It cannot load the libraries or define native methods.
  • It cannot ordinarily read or write the files on host that is executing it.
  • It cannot make network connections except the host which it came from
  • It cannot start any program on the host which is executing it.
  • It cannot read every system property.
  • Windows which an applet brings up look different than windows which an aplication brings up.

Each browser do have a SecurityManager object which checks for the applet security violations. When a SecurityManager detects violation, it throws up an SecurityException.

The Applet Capabilities
Here are some of the other things that an applet can do which you might not expect:

  • Applets running within the Web browser can easily cause an HTML documents to be displayed.
  • Applets can do invoke the public methods of other applets on same page.
  • Applets that are loaded from local file system (from a directory in user's CLASSPATH) have none of the restrictions that applets loaded over the network do have.
  • Although most of the applets stop running once you leave their page.

The java.applet package provides the API that gives an applets some capabilities which applications dont have. as an applets can play sounds, which other programs cannot do.




Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords: java applet download, gameboyemu java applet, free java applet, java applet games, java applet package, java applet tutorial, loading java applet failed, java djvu viewer applet, java applet that will calculate when, java applet developer provides highly adaptive


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.