Skip to content

Commit fe73ef5

Browse files
committed
Chapter 02 section 04 updated.
1 parent 9f8d82e commit fe73ef5

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

02-Java-Swing-Basics/04-Using-Graphics2D/src/AlgoFrame.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,17 @@ private class AlgoCanvas extends JPanel{
3939
public void paintComponent(Graphics g) {
4040
super.paintComponent(g);
4141

42-
//g.drawOval(50, 50, 300, 300);
43-
4442
Graphics2D g2d = (Graphics2D)g;
4543

46-
int strokeWidth = 10;
44+
int strokeWidth = 5;
4745
g2d.setStroke(new BasicStroke(strokeWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
4846

4947
g2d.setColor(Color.RED);
50-
Ellipse2D circle = new Ellipse2D.Double(50, 50, 600, 600);
48+
Ellipse2D circle = new Ellipse2D.Double(50, 50, 300, 300);
5149
g2d.draw(circle);
5250

5351
g2d.setColor(Color.BLUE);
54-
Ellipse2D circle2 = new Ellipse2D.Double(50, 50, 600, 600);
52+
Ellipse2D circle2 = new Ellipse2D.Double(50, 50, 300, 300);
5553
g2d.fill(circle2);
5654
}
5755

02-Java-Swing-Basics/04-Using-Graphics2D/src/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class Main {
66
public static void main(String[] args) {
77

88
EventQueue.invokeLater(() -> {
9-
AlgoFrame frame = new AlgoFrame("Welcome",800,800);
9+
AlgoFrame frame = new AlgoFrame("Welcome",500,500);
1010
});
1111
}
1212
}

02-Java-Swing-Basics/Chapter-02.key

77.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)