-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircles.java
More file actions
39 lines (29 loc) · 778 Bytes
/
Circles.java
File metadata and controls
39 lines (29 loc) · 778 Bytes
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
34
35
36
37
38
39
//(c) A+ Computer Science
// www.apluscompsci.com
//graphics example for circles/ovals
import java.awt.Graphics;
import java.awt.Color;
import java.awt.Canvas;
public class Circles extends Canvas
{
public Circles()
{
setBackground(Color.WHITE);
}
public void paint( Graphics window )
{
window.setColor(Color.BLACK);
window.drawString("Circles - Ovals", 50, 30);
window.setColor(Color.BLUE);
//drawOval(int x1, int y1, int width, int height)
window.drawOval(100,50,40,40);
window.setColor(Color.GREEN);
window.drawOval(100,100,100,50);
window.setColor(Color.YELLOW);
window.fillOval(100,150,50,50);
window.setColor(Color.RED);
window.fillOval(100,200,50,50);
window.setColor(Color.BLUE);
window.fillOval(100,250,80,80);
}
}