The HTML <applet> tag specifies an applet. It is used for embedding a Java applet within an HTML document. It is not supported in HTML5.
Example
<!DOCTYPE html> <html> <head> <title>HTML applet Tag</title> </head> <body> <applet code="newClass.class" width="300" height="200"> </applet> </body> </html>
Here is the newClass.java file:
import java.applet.*;
import java.awt.*;
public class newClass extends Applet
{
 public void paint (Graphics gh)
   {
      g.drawString("java applet", 300, 150);
   }
}
 
No comments:
Post a Comment