Monday, 11 May 2015

Applet programming displaying a smiley

Exported from Notepad++
import java.awt.*; import java.applet.*; public class Smile extends Applet{ //this class imports Applet and Graphics packages public void paint(Graphics g){ //this is used for font Font f = new Font("Helvetica", Font.BOLD,20); g.setFont(f); //this is for text on applet viewer g.drawString("Keep Smiling!!!", 100, 30); //for drawing oval g.drawOval(60, 60, 200, 200); //an oval with filling colour inside. g.fillOval(90, 120, 50, 20); g.fillOval(190, 120, 50, 20); //for lines g.drawLine(165, 125, 165, 175); //for 2DArc g.drawArc(110, 130, 95, 95, 0, -180); } }


No comments:

Post a Comment