...............STEPS TO RUN APPLET THROUGH COMMAND PROMPT
STEP 1. open commad prompt and type "javac filename.java. "
STEP 2. write "appletviewer classname.java" ..............
...................................................................................................................................................................
import java.awt.*;
import java.applet.*;
public class smiley extends Applet
{
public void paint(Graphics g)
{
setBackground(Color.blue);
g.setColor(Color.yellow);
g.drawOval(200,200,100,100);
g.setColor(Color.yellow);
g.fillOval(200,200,100,100);
g.setColor(Color.black);
g.drawOval(220,220,20,20);
g.fillOval(220,220,20,20);
g.drawOval(260,220,20,20);
g.fillOval(260,220,20,20);
g.drawArc(220,230,60,60,180,170);
}
}
/*<applet code="smiley.java" width ="400" height="500"></applet>*/
/*........................PASTE THIS PROGRAM AS IT IS.......................*/
STEP 1. open commad prompt and type "javac filename.java. "
STEP 2. write "appletviewer classname.java" ..............
...................................................................................................................................................................
PROGRAM
import java.awt.*;
import java.applet.*;
public class smiley extends Applet
{
public void paint(Graphics g)
{
setBackground(Color.blue);
g.setColor(Color.yellow);
g.drawOval(200,200,100,100);
g.setColor(Color.yellow);
g.fillOval(200,200,100,100);
g.setColor(Color.black);
g.drawOval(220,220,20,20);
g.fillOval(220,220,20,20);
g.drawOval(260,220,20,20);
g.fillOval(260,220,20,20);
g.drawArc(220,230,60,60,180,170);
}
}
/*<applet code="smiley.java" width ="400" height="500"></applet>*/
/*........................PASTE THIS PROGRAM AS IT IS.......................*/
Its Awesome nice!!
ReplyDelete