Guest User

Untitled

a guest
Apr 4th, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5.  
  6. public class FrameofSetAlarm implements ActionListener {
  7. JFrame gir = new JFrame();
  8. JTextField t1, t2, t3;
  9. JLabel l1;
  10. JPanel pl;
  11. JButton b1;
  12.  
  13. public void Ruin() {
  14. t1 = new JTextField(5);
  15. t2 = new JTextField(10);
  16. t1.setText("00");
  17. t2.setText("00");
  18. l1 = new JLabel("Введите время: ");
  19. b1 = new JButton("OK");
  20. b1.addActionListener(this);
  21. pl = new JPanel();
  22. pl.setLayout(new FlowLayout());
  23.  
  24. pl.add(l1);
  25. pl.add(t1);
  26. pl.add(t2);
  27. pl.add(b1);
  28. gir.add(pl);
  29. gir.setLocationRelativeTo(null);
  30. gir.setSize(500, 100);
  31. gir.setVisible(true);
  32. }
  33.  
  34. @Override
  35. public void actionPerformed(ActionEvent e) {
  36. if (e.getSource() == b1) {
  37. Chasi ch = new Chasi();
  38. ch.Clock();
  39. ch.setA(Integer.parseInt(t1.getText()));
  40. ch.setB(Integer.parseInt(t2.getText()));
  41. gir.dispose();
  42.  
  43. }
  44.  
  45. }
  46. }
Add Comment
Please, Sign In to add comment