-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnglishLanguage.java
More file actions
85 lines (67 loc) · 2.92 KB
/
EnglishLanguage.java
File metadata and controls
85 lines (67 loc) · 2.92 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package ru.karproj.snaker;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class EnglishLanguage extends JFrame {
private JButton button = new JButton("Confirm");
private JTextField input = new JTextField("", 5);
private JLabel lable = new JLabel("Your name:");
private JRadioButton radio1 = new JRadioButton("Dentist");
private JRadioButton radio2 = new JRadioButton("Surgeon");
private JRadioButton radio3 = new JRadioButton("Therapist");
private JCheckBox check = new JCheckBox("Registr", false);
public EnglishLanguage() {
super("English");
this.setBounds(350, 350, 450, 400);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container container = this.getContentPane();
container.setLayout(new GridLayout(5, 5, 2, 2));
container.add(lable);
container.add(input);
container.setBackground(Color.cyan);
ButtonGroup group = new ButtonGroup();
Font f1 = new Font("TimesRoman", Font.BOLD, 13);
radio1.setFont(f1);
radio2.setFont(f1);
radio3.setFont(f1);
group.add(radio1);
group.add(radio2);
group.add(radio3);
container.add(radio1);
radio1.setSelected(true);
container.add(radio2);
container.add(radio3);
container.add(check);
button.addActionListener(new ButtonEventListener2());
container.add(button);
}
class ButtonEventListener2 implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
boolean b = false;
String message = "";
do {
try {
if (!check.isSelected()) {
message+= "Registration was't finished!!!\n";
} else {
message += "Service was chosen\n";
message += "Name:" + " " + input.getText() + "\n";
message += "The number of people before you:" + " " + (int) (Math.random() * 20) + "\n";
if (radio1.isSelected())
message += "Doctor's name:" + " " + "Kurmangazieva Leila \n";
if (radio2.isSelected())
message += "Doctor's name:" + " " + " Kenesh Abdilda Sagadibekuly\n";
if (radio3.isSelected())
message += "Doctor's name:" + " " + " Kosybaeva Umitzhan Amankeldykizy\n";
}
} catch (Exception e1) {
break;
}
} while (b);
JOptionPane.showMessageDialog(null, message, "Check", JOptionPane.PLAIN_MESSAGE);
}
}
}