Java Applets: By:-Darshana D Ghadi
Java Applets: By:-Darshana D Ghadi
By :- Darshana D Ghadi
What is Java Applet ?
Java Applets are dynamic and interactive programs, were
introduced in the first version of the Java language in 1995.
Execution Platforms
Microsoft Windows, Unix, Mac OS and Linux
Features of an Applet
Provides facility for frames
Event handling facility and user Interaction
GUI
Graphics and multimedia
Example
import java.applet.Applet.*;
import java.awt.*;
To
save the program & compile follow the steps :-
Start -> Run -> cmd -> c:jdk.1.5bin -> hello.java
After compilation type in the following HTML code in your editor and
save the file as hello.html
<applet code = "classhello.class" width = 200 height =150 >
</applet>
Font Class :-
Font f = new Font("Courier",Font.BOLD+Font.Italic, 16);
g.setFont(f);
Color Class :-
Layout Managers
Flow Layout
Border Layout
Grid Layout
Card Layout
Applications of Java Applet
Entertainment
Communication
Educational Tools
Mobile Programs
http://rainbowuniverse.org/id55.htm
Advantages
It is simple
It can work on any platform
No need to support legacy versions
Applet naturally supports the changing user state, such as figure positions
on the chessboard
An untrusted applet has no access to the local machine and can only
access the server it came from.
Java applets are fast
Disadvantages
It requires the Java plug-in.
Security restrictions may make it difficult or even impossible for an
untrusted applet to achieve the desired goals.
Some applets require a specific JRE. This is discouraged.
THANK YOU !