- /*
- 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);
- }
- }
Welcome to the world of Java examples, organized by categories and Java packages. Java examples (Java sample source code) help to understand functionality of various Java classes and methods as well as various programming techniques in a simple way, which is otherwise very hard to learn by reading tutorials or Java API. So start exploring...
Sunday, November 27, 2011
Draw Smiley In Applet Example
Subscribe to:
Post Comments (Atom)
How to find the most appropriate Keywords?
🔍 Step 1: Understand Your Business and Audience Define your products, services, or content . Identify your target audien...
No comments:
Post a Comment