Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- import java.awt.BorderLayout;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JDialog;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- public class Programy extends JDialog implements ActionListener {
- private static JFrame rodzic;
- private JButton bWstecz, bWyjście;
- public Programy(JFrame f) {
- rodzic = f;
- setSize(800,800);
- setTitle("Test");
- setLayout(null);
- setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- bWstecz = new JButton("Wstecz");
- bWstecz.setBounds(550, 700, 100, 20);
- add(bWstecz);
- bWstecz.addActionListener(this);
- bWyjście = new JButton("Wyjście");
- bWyjście.setBounds(650, 700, 100, 20);
- add(bWyjście);
- bWyjście.addActionListener(this);
- }
- public void closeDialog() {
- rodzic.setVisible(true);
- setVisible(false);
- }
- @Override
- public void actionPerformed(ActionEvent e)
- {
- Object z = e.getSource();
- if (z==bWstecz)
- closeDialog();
- else if (z == bWyjście) dispose();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement