Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1. package bazav2;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5.  
  6. import javax.swing.JButton;
  7. import javax.swing.JFrame;
  8. import javax.swing.JTextField;
  9.  
  10.  
  11.  
  12. public class oknoglowne extends JFrame implements ActionListener {
  13.    
  14.     public static oknoglowne okgl;
  15.    
  16.     public oknoglowne() {
  17.        
  18.         JTextField Tszukaj;
  19.         JButton Bszukaj, Bdn, Bwyjscie;
  20.        
  21.         setSize(600,500);
  22.         setTitle("Busexpress24");
  23.         setLayout(null);
  24.        
  25.         Tszukaj = new JTextField("");
  26.         Tszukaj.setBounds(20,20,150,20);
  27.         add(Tszukaj);
  28.        
  29.        
  30.         Bszukaj = new JButton("szukaj");
  31.         Bszukaj.setBounds(170,20,150,20);
  32.         add(Bszukaj);
  33.        
  34.         Bdn = new JButton("Dodaj nowy");
  35.         Bdn.setBounds(20,60,150,20);
  36.         add(Bdn);
  37.        
  38.         Bwyjscie = new JButton("wyjscie");
  39.         Bwyjscie.setBounds(170,60,150,20);
  40.         add(Bwyjscie);
  41.        
  42.         Bdn.addActionListener(new bbbb());
  43.        
  44.    
  45.     }
  46.    
  47.  
  48.     public class bbbb implements ActionListener
  49.     {
  50.     @Override
  51.     public void actionPerformed(ActionEvent e) {
  52.         // TODO Auto-generated method stub
  53.        
  54.        
  55.         okgl.setVisible(false);
  56.         oknoglowne pododajnowy = new oknoglowne();
  57.         pododajnowy.setVisible(true);
  58.        
  59.        
  60.        
  61.     }
  62. }
  63.  
  64.     public static void main(String[] args) {
  65.         // TODO Auto-generated method stub
  66.        
  67.         oknoglowne okienkog = new oknoglowne();
  68.         okienkog.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  69.         okienkog.setVisible(true);
  70.  
  71.     }
  72.  
  73.  
  74.     @Override
  75.     public void actionPerformed(ActionEvent e) {
  76.         // TODO Auto-generated method stub
  77.        
  78.     }
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement