Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- public class FrameAlarm implements ActionListener {
- Yeap y = new Yeap();
- JFrame fr = new JFrame();
- JButton b1 = new JButton("БУДИЛЬНИК");
- Chasi ch = new Chasi();
- JLabel l1 = new JLabel();
- JLabel l2 = new JLabel("КУКУ");
- JButton b2 = new JButton("Установить звук");
- public void Frame() {
- ch.Clock();
- l1 = ch.l1;
- JPanel pl = new JPanel();
- l2.setVisible(false);
- pl.setLayout(new BorderLayout());
- pl.add(l2, BorderLayout.SOUTH);
- pl.add(l1, BorderLayout.CENTER);
- pl.add(b1, BorderLayout.EAST);
- pl.add(b2, BorderLayout.PAGE_END);
- b1.addActionListener(this);
- b2.addActionListener(this);
- fr.add(pl);
- fr.setVisible(true);
- fr.setSize(500, 400);
- fr.setLocationRelativeTo(null);
- }
- public static void main(String[] args) {
- FrameAlarm g = new FrameAlarm();
- g.Frame();
- }
- @Override
- public void actionPerformed(ActionEvent eu) {
- if (eu.getSource() == (b1)) {
- FrameofSetAlarm tr = new FrameofSetAlarm();
- tr.Ruin();
- }else if(eu.getSource()==b2){
- ChooseFileForAlarm ch = new ChooseFileForAlarm();
- ch.ChooseFile();
- }
- }
- }
Add Comment
Please, Sign In to add comment