1public class scratch {
2 public static void main(String[] args) {
3 JFrame window = new JFrame();
4 window.setTitle("Christmas Tree");
5 window.setSize(700, 600);
6 window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
7 window.setVisible(true);
8 DrawingComponent DC = new DrawingComponent();
9 window.add(DC);
10 }
11}
12class DrawingComponent extends JComponent{
13 public void paint(Graphics graph0){
14 Graphics2D graph = (Graphics2D) graph0;
15 Ellipse2D.Double circle = new Ellipse.Double(5, 5, 25, 25);
16 graph.fill(circle);
17 }
18}