-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathFlag
More file actions
33 lines (26 loc) · 696 Bytes
/
Flag
File metadata and controls
33 lines (26 loc) · 696 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
package acm;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JFrame;
public class BD_Flag {
private static JFrame frame;
public static void main(String[] args) {
frame = new JFrame();
frame.setBounds(100, 100, 800, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Flag flag = new Flag();
frame.getContentPane().add(flag);
frame.setVisible(true);
}
}
class Flag extends JComponent{
@Override
protected void paintComponent(Graphics g) {
g.setColor(new Color(0, 103, 71));
g.fillRect(50, 50, 720, 432);
g.setColor(new Color(218, 41, 28));
g.fillOval(230, 122, 288, 288);
super.paintComponent(g);
}
}