Syntax for Execute this program :
Firstly then name of class and file should be and run your java file
Syntax : Appletviewer filename.java
Example : Appletviewer simple_applet.javaimport java.awt.*;
import java.applet.*;
/*
<html>
<body>
<applet code="insert_image" width=800 height=800>
</applet>
</body>
</html>
*/
public class insert_image extends Applet
{
Image picture;
public void init()
{
picture = getImage(getDocumentBase(),"friendss.jpg");
}
public void paint(Graphics g)
{
g.drawImage(picture,30,30,this);
}
}
OUTPUT

Copyright ©
All Notes on BCA