Question: Make a graphics program that displays a smiley face on the screen. The circle must be yellow. There must be a curve of a smile

Make a graphics program that displays a "smiley face" on the screen. The circle must be yellow. There must be a curve of a smile in the lower part of the face, and two small circles for eyes in the upper part of the face. The "mouth" should be red and the eyes should be blue.

i did this so far but i dont think so its right. can someone plz help?

import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.Color; import java.awt.Graphics;

public class Smlyfc{

public static void main(String[] args){ JFrame frame = new JFrame("Example Frame"); frame.setSize(300, 300); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); panel.setBackground(Color.White); Graphics graphics = panel.getGraphics(); frame.add(panel); graphics.setColor(Color.YELLOW); graphics.fillRect(0, 0, 100, 100); frame.toFront(); }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!