Guest User

Untitled

a guest
Apr 4th, 2016
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 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 FrameAlarm implements ActionListener {
  7. Yeap y = new Yeap();
  8. JFrame fr = new JFrame();
  9. JButton b1 = new JButton("БУДИЛЬНИК");
  10. Chasi ch = new Chasi();
  11. JLabel l1 = new JLabel();
  12. JLabel l2 = new JLabel("КУКУ");
  13. JButton b2 = new JButton("Установить звук");
  14.  
  15. public void Frame() {
  16. ch.Clock();
  17. l1 = ch.l1;
  18. JPanel pl = new JPanel();
  19. l2.setVisible(false);
  20.  
  21. pl.setLayout(new BorderLayout());
  22. pl.add(l2, BorderLayout.SOUTH);
  23. pl.add(l1, BorderLayout.CENTER);
  24. pl.add(b1, BorderLayout.EAST);
  25. pl.add(b2, BorderLayout.PAGE_END);
  26. b1.addActionListener(this);
  27. b2.addActionListener(this);
  28. fr.add(pl);
  29. fr.setVisible(true);
  30. fr.setSize(500, 400);
  31. fr.setLocationRelativeTo(null);
  32. }
  33.  
  34. public static void main(String[] args) {
  35. FrameAlarm g = new FrameAlarm();
  36. g.Frame();
  37. }
  38.  
  39. @Override
  40. public void actionPerformed(ActionEvent eu) {
  41. if (eu.getSource() == (b1)) {
  42. FrameofSetAlarm tr = new FrameofSetAlarm();
  43. tr.Ruin();
  44. }else if(eu.getSource()==b2){
  45. ChooseFileForAlarm ch = new ChooseFileForAlarm();
  46. ch.ChooseFile();
  47. }
  48. }
  49.  
  50. }
Add Comment
Please, Sign In to add comment