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.JDialog;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- public class SoftwarePackage extends javax.swing.JFrame implements ActionListener
- {
- private JButton bDalej, bWyjście;
- public Test() {
- setSize(800,800);
- setTitle("test");
- setLayout(null);
- setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- bDalej = new JButton("Dalej");
- bDalej.setBounds(550, 700, 100, 20);
- add(bDalej);
- bDalej.addActionListener(this);
- bWyjście = new JButton("Wyjście");
- bWyjście.setBounds(650, 700, 100, 20);
- add(bWyjście);
- bWyjście.addActionListener(this);
- }
- public void openDialog() {
- setVisible(false);
- Programy p;
- p = new Programy(this);
- p.setVisible(true);
- }
- /**
- * @param args
- */
- public static void main(String[] args) {
- Test okienko = new Test();
- okienko.setVisible(true);
- }
- @Override
- public void actionPerformed(ActionEvent e) {
- Object z = e.getSource();
- if (z == bDalej)
- {
- openDialog();
- i++;
- }
- else if (z == bWyjście) dispose();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement