..\CSC120\Java\lec05\src\SmileySun.java
 1 
 2 import java.awt.Color;
 3 import java.awt.Graphics;
 4 
 5 /*
 6  * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 7  * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 8  */
 9 
10 /**
11  *
12  * @author CINDRICBB
13  */
14 public class SmileySun {
15     
16     private Integer anchorX, anchorY;
17     private Color eyeSmileColor;
18     
19     public SmileySun(Integer x, Integer y, Color c) {
20         anchorX = x;
21         anchorY = y;
22         eyeSmileColor = c;
23     } // end of constructor
24     
25     public void draw(Graphics g) {
26         g.setColor(Color.YELLOW);
27         g.fillOval(anchorX, anchorY, 90, 90);
28         g.setColor(eyeSmileColor);
29         g.fillOval(anchorX+15, anchorY+30, 15, 15);
30         g.fillOval(anchorX+60, anchorY+30, 15, 15);
31         g.drawArc(anchorX+15, anchorY+35, 60, 40, 180, 180);
32     } // end of draw
33     
34     
35 }  // end of class SmileySun
36