.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Applet in JAVA showing a smiling face.

Posted By:Abhisek Panda       Posted Date: February 26, 2010    Points: 10    Category: OOPS    URL: http://www.dotnetspark.com  

The program shows an applet containing a smiling face.
 

The following program will display an applet with a smiling face.

import java.awt.*;

import java.applet.*;

/*





*/



public class Face extends Applet

{

public void paint(Graphics g)

{

g.setColor(Color.red);

g.drawOval(40,40,120,150);

g.drawOval(57,75,30,20);

g.drawOval(110,75,30,20);

g.fillOval(68,81,10,10);

g.fillOval(121,81,10,10);

g.drawOval(85,100,30,40);

showStatus("This is your face");//show the message in the status bar

}

}

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend