import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class FrameofSetAlarm implements ActionListener { JFrame gir = new JFrame(); JTextField t1, t2, t3; JLabel l1; JPanel pl; JButton b1; public void Ruin() { t1 = new JTextField(5); t2 = new JTextField(10); t1.setText("00"); t2.setText("00"); l1 = new JLabel("Введите время: "); b1 = new JButton("OK"); b1.addActionListener(this); pl = new JPanel(); pl.setLayout(new FlowLayout()); pl.add(l1); pl.add(t1); pl.add(t2); pl.add(b1); gir.add(pl); gir.setLocationRelativeTo(null); gir.setSize(500, 100); gir.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == b1) { Chasi ch = new Chasi(); ch.Clock(); ch.setA(Integer.parseInt(t1.getText())); ch.setB(Integer.parseInt(t2.getText())); gir.dispose(); } } }