How to draw shape of smiley in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to draw shape of smiley in java?

using java applet

17th Sep 2017, 12:38 PM
AKcd
3 Answers
+ 8
public class Program { public static void main(String[] args) { System.out.println(":-)"); } }
17th Sep 2017, 12:51 PM
Ahri Fox
Ahri Fox - avatar
+ 6
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);         } } // Won't work on the code playground.
17th Sep 2017, 12:55 PM
Dev
Dev - avatar
0
i want to draw using java applets
17th Sep 2017, 12:54 PM
AKcd