-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestionOnExitPanel.java
53 lines (43 loc) · 1.55 KB
/
QuestionOnExitPanel.java
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import java.awt.Color;
import javax.swing.*;
public class QuestionOnExitPanel extends JPanel {
QuestionOnExitPanel() {
JLabel question = new JLabel("Are you sure?");
question.setBounds(50, 30, 90, 30);
JButton yesButton = new JButton("YES");
yesButton.setBounds(30, 80, 60, 30);
yesButton.setBackground(Color.GREEN);
JButton noButton = new JButton("NO");
noButton.setBounds(100, 80, 60, 30);
noButton.setBackground(Color.RED);
setBackground(Color.CYAN);
setSize(200, 150);
setLayout(null);
add(question);
add(yesButton);
add(noButton);
// }
// public static void main(String[] args) {
// JFrame f = new JFrame();
// JLabel question = new JLabel("Are you sure?");
// question.setBounds(50,30,90,30);
// JButton yesButton = new JButton("YES");
// yesButton.setBounds(30,80,60,30);
// yesButton.setBackground(Color.GREEN);
// JButton noButton = new JButton("NO");
// noButton.setBounds(100,80,60,30);
// noButton.setBackground(Color.RED);
// JPanel panel = new JPanel();
// panel.setBackground(Color.CYAN);
// panel.setSize(200,150);
// panel.setLayout(null);
// panel.add(question);
// panel.add(yesButton);
// panel.add(noButton);
// f.add(panel);
// f.setSize(350,350);
// f.setLayout(null);
// f.setVisible(true);
// }
}
}