..\CSC120\Java\lec05\src\LollipopTree.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 LollipopTree {
15     
16     private Integer anchorX, anchorY;
17     
18     // constructor method
19     public LollipopTree(Integer x, Integer y) {
20         anchorX = x;
21         anchorY = y;
22     } // end of constructor
23     
24     // other methods
25     public void draw(Graphics g) {
26         g.setColor(new Color(102, 51, 0));
27         g.fillRect(anchorX+60, anchorY+20, 30, 150);
28         g.setColor(Color.GREEN);
29         g.fillOval(anchorX, anchorY, 150, 80);
30     } // end of draw
31     
32 } // end of class LollipopTree
33