-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.java
More file actions
37 lines (35 loc) · 1.04 KB
/
Copy pathTester.java
File metadata and controls
37 lines (35 loc) · 1.04 KB
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
import java.awt.*;
public class Tester{
public static void main(String[] args){
MainFrame m = new MainFrame();
ACanvas arrayCanvas = new ACanvas();
Canvas a = new Canvas();
a.setBackground(Color.red);
a.setBounds(100,100,200,200);
ACanvas b = new ACanvas();
b.setBackground(Color.blue);
b.setBounds(150, 150, 25, 25);
arrayCanvas.setSize(200,200);
arrayCanvas.setBackground(Color.BLACK);
m.add(arrayCanvas);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
arrayCanvas.setSize(500,500);
arrayCanvas.add(b);
arrayCanvas.add(a);
arrayCanvas.add(new ACanvas(0,0,100,100, Color.white));
for (int i = 0; i <51; i++){
arrayCanvas.add(new ACanvas(i*2, i*2, 50,50, new Color((int)(Math.random()*255), (int)(Math.random()*255), (int)(Math.random()*255))));
arrayCanvas.paint();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
arrayCanvas.paint();
}
}