Submitted By: Sagar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
/* Draw Smiley In Applet Example This Java example shows how to to draw smiley in an applet window using drawString Java Applet class. */ import java.awt.*; import java.applet.*; public class Smiley extends Applet{ public void paint(Graphics g){ Font f = new Font("Helvetica", Font.BOLD,20); g.setFont(f); g.drawString("Keep Smiling!!!", 50, 30); g.drawOval(60, 60, 200, 200); g.fillOval(90, 120, 50, 20); g.fillOval(190, 120, 50, 20); g.drawLine(165, 125, 165, 175); g.drawArc(110, 130, 95, 95, 0, -180); } } |
please post the screenshot of the program for this program
same]
🙂
many errors :3
import java.awt.*;
import java.applet.*;
public class Simple extends Applet{
public void paint(Graphics g){
Font f = new Font(“Helvetica”, Font.BOLD,20);
g.setFont(f);
g.drawString(“Keep Smiling!!!”, 50, 30);
g.drawOval(60, 60, 200, 200);
g.fillOval(90, 120, 50, 20);
g.fillOval(190, 120, 50, 20);
g.drawLine(165, 125, 165, 175);
g.drawArc(110, 130, 95, 95, 0,-180);
}
}
/*<applet code=”Simple” width=”1000″ height=”1000″></applet>*/
is program ko run karao jo humne send kiya hai