-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKazakhLanguage.java
More file actions
82 lines (68 loc) · 3.17 KB
/
KazakhLanguage.java
File metadata and controls
82 lines (68 loc) · 3.17 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
package ru.karproj.snaker;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class KazakhLanguage extends JFrame {
private JButton button = new JButton("Растау");
private JTextField input = new JTextField("", 5);
private JLabel lable = new JLabel("Аты-жөні:");
private JRadioButton radio1 = new JRadioButton("Тіс дәрігер");
private JRadioButton radio2 = new JRadioButton("Хирург");
private JRadioButton radio3 = new JRadioButton("Терапевт");
private JCheckBox check = new JCheckBox("\n" +
"Регистр", false);
public KazakhLanguage() {
super("Қазақ тілі");
this.setBounds(350, 350, 450, 400);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container container = this.getContentPane();
container.setBackground(Color.cyan);
container.setLayout(new GridLayout(5, 5, 2, 2));
container.add(lable);
container.add(input);
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);
container.add(button);
button.addActionListener(new ButtonEventListener1());
}
class ButtonEventListener1 implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
boolean b = false;
String message = " ";
do {
try {
if (!check.isSelected()) {
message+= "Тіркеу аяқталмады\n";
} else {
message += "Қызмет таңдалды\n";
message += "Аты-жөні" + " "+ input.getText() + "\n";
message += "Сіздің алдыңызда" + " " + (int) (Math.random() * 20) + " " + " адам бар" + "\n";
if (radio1.isSelected())
message += "Дәрігердің аты-жөні:" + " " + " Құрманғазиева Лейла\n";
if (radio2.isSelected())
message += "Дәрігердің аты-жөні:" + " " + "Кенеш Әбділда Сағадибекұлы\n";
if (radio3.isSelected())
message += "Дәрігердің аты-жөні:" + " " + "Қосыбаева Умітжан Аманкелдықызы\n";
}
} catch (Exception e1) {
break;
}
} while (b);
JOptionPane.showMessageDialog(null, message, "Купон", JOptionPane.PLAIN_MESSAGE);
}
}
}