title: JAVA - Can't add Text Field and Button to container
body: <p>I'm trying to do a little program that use some buttons and text field. 
  I was able to create window with <code>JPanel</code> but don't have idea how to add button and text field</p>
  
  <p>The code I'm using is:</p>
  
  <pre><code>public UI() {
  
      sprites = new HashMap();
     // spriteCache = stage.getSpriteCache();
      JFrame okno = new JFrame ("VoLTE Script");
      setBounds(0,0,SZEROKOSC,WYSOKOSC);
      JPanel panel = (JPanel)okno.getContentPane(); 
      panel.setLayout (null);
      panel.add(this);
      okno.setBounds(0,0,800,600);
      okno.setVisible(true);
      JTextField pole = new JTextField(10);
      JButton przycisk = new JButton("teasda");
      przycisk.setPreferredSize(new Dimension(300, 350));
      przycisk.setLayout(new BorderLayout());
      panel.add(przycisk);
      przycisk.setVisible(true);
      pole.setBounds (300,300,200,200); 
      pole.setLayout(null);
      pole.setVisible(true);
      panel.add(pole);
  
      okno.addWindowListener(new WindowAdapter(){
              public void windowClosing (WindowEvent e){
                  System.exit(0);
              }
      });
      okno.setResizable(false);
  
      createBufferStrategy(2);
      strategia=getBufferStrategy();
      requestFocus();
     // addKeyListener(this);
     // addMouseListener(this);
  
      }
  </code></pre>