-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeddyBear.java
33 lines (30 loc) · 904 Bytes
/
TeddyBear.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.awt.*;
import javax.swing.*;
public class TeddyBear extends JFrame{
TeddyBear(){
this.setTitle("Teddy Bear");
this.setSize(1000, 1000);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
@Override
public void paint(Graphics g){
g.setColor(Color.blue);
g.fillOval(75, 75, 100, 100);
g.fillOval(220, 75, 100, 100);
g.setColor(Color.white);
g.fillOval(90, 90, 75, 75);
g.fillOval(235, 90, 75, 75);
g.setColor(Color.blue);
g.fillOval(100, 100, 200, 200);
g.setColor(Color.white);
g.fillOval(145, 160, 30, 30);
g.fillOval(225, 160, 30, 30);
g.fillOval(175,210, 50, 50);
g.setColor(Color.blue);
g.fillOval(170,190, 60, 60);
}
public static void main(String[] args) {
new TeddyBear();
}
}