Hi everyone, I am trying to write and application that will display a smiley face with a gray background and yellow face. This is what I have so far but it won't run. Can you please help me and show me how to get the application running? Thank you in advance.
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Canvas;
public class Smileyface extends Canvas {
public static void main(String[] args) {
public smileyface() {
setSize(800, 600);
setBackground(Color.GRAY);
setVisible(true);
}
public void smileyface(Graphics window) {
smileyFace(window);
}
public void smileyFace(Graphics window) {
window.setColor(Color.YELLOW);
window.drawString("SMILEY FACE LAB ", 35, 35);
window.setColor(Color.YELLOW);
window.fillOval(210, 100, 400, 400); // face
window.setColor(Color.WHITE);
window.fillOval(290, 180, 40, 40); // left cornea
window.fillOval(490, 180, 40, 40); // right cornea
window.setColor(Color.BLACK);
window.fillOval(300, 190, 20, 20); // left iris
window.fillOval(500, 190, 20, 20); // right iris
window.fillArc(310, 200, 200, 200, 0, -180); // smile
}
}
}