How we run Applet:
1.By HTML file.
2.By Applet viewer.
One example for both :
import java.applet.*;
import java.awt.*;
public class apple extends Applet
{
public void paint(Graphics g)
{
g.drawString("hello",90,100);
}
}
/*<applet code=apple.class height=300 width=300>
</applet>*/
Or write html program for external browser and no need to write comment applet code ...
<html>
<head><title>applet eg.</title>
</head>
<body>
<applet code=apple.class height=300 width=300>
</applet>>
</body>
</html>
No comments:
Post a Comment