質問編集履歴
1
コードに不適切な部分があった
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
```java
|
12
12
|
Vector<Rectangle> shapes_ = new Vector<Rectangle>();
|
13
|
+
Color BACK_COLOR = new Color(0,0,0,0);
|
14
|
+
Color PEN_COLOR = Color.BLACK;
|
13
15
|
|
14
16
|
@Override
|
15
17
|
public void paintComponent( Graphics g )
|
@@ -19,12 +21,12 @@
|
|
19
21
|
r = shapes_.get( shapes_.size() - 1 );
|
20
22
|
g.drawLine( r.x, r.y, r.width, r.height );
|
21
23
|
}else if( shapes_.size() == 3 ){
|
22
|
-
|
24
|
+
g.setColor( BACK_COLOR );
|
23
25
|
r = shapes_.get( 1 );
|
24
26
|
g.drawLine( r.x, r.y, r.width, r.height );
|
25
27
|
g.setColor( PEN_COLOR );
|
26
28
|
r = shapes_.get( 2 );
|
27
|
-
g.drawLine( r.x, r.y, r.width, r.height );
|
29
|
+
g.drawLine( r.x, r.y, r.width, r.height );
|
28
30
|
}else{
|
29
31
|
}
|
30
32
|
}
|