Today we were taught about the applets in Java.Applet is java program that can be embedded into HTML pages. Java applets runs on the java enables web browsers such as mozila and internet explorer. Applet is designed to run remotely on the client browser, so there are some restrictions on it. Applet can’t access system resources on the local computer. Applets are used to make the web site more dynamic and entertaining.
Advantages of Applet:
Applets are cross platform and can run on Windows, Mac OS and Linux platform
Applets can work all the version of Java Plugin
Applets runs in a sandbox, so the user does not need to trust the code, so it can work without security approval
Applets are supported by most web browsers
Applets are cached in most web browsers, so will be quick to load when returning to a web page
User can also have full access to the machine if user allows
import java.awt.*;
import java.applet.*;
public class app extends Applet{
public void init()
{
Font f= new Font(“Monotype”,1,12);
SetFont(f);
}
public void paint(Graphics g)
{
g.drawLine (x1,y1,x2,y2);
g.setcolor(Color.RED);
g.fillRect;
g.drawString;
}
0 comments:
Post a Comment