loader image

Java program to display a smiling face

Write a multi-thread java program for displaying odd numbers and even numbers up to a limit.

import java.applet.*;
import java.awt.*;
  
public class Smiley extends Applet {
    public void paint(Graphics g)
    {
  
        // face outline
        g.drawOval(80, 70, 150, 150);
  
        // eyes
        g.setColor(Color.BLACK);
        g.fillOval(120, 120, 15, 15);
        g.fillOval(170, 120, 15, 15);
  
        // smile
        g.drawArc(130, 180, 50, 20, 180, 180);
    }
}

Output

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top