title: Array trouble in java
body: <p>Hello 
  I'm making a program that tracks the number of users that are logged on by entering names through textfield0. I hit a road block being new to java I still don't understand some things I was wondering how  one would add names to the array User in real time and have the array be count it show it in textfield1.</p>
  
  <p>Thank you in advance.</p>
  
  <pre><code>public class UserTracking {
  
  
      public static void main(String[] args){
          final Kong f = new Kong();
          f.pack();
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.setSize(200,110);
          f.setVisible(true);
  
      }
  
  
  }
  class Kong extends JFrame implements  ActionListener
  {
      JTextField textfield0 = new JTextField();
      JTextField textfield1 = new JTextField();
      JLabel  label0 = new JLabel("User");
      JLabel  label1 = new JLabel("Number of Users:");
      JButton btnon = new JButton("Log on");
      JButton btnoff = new JButton("Log off");
      String User[] ={};
  
  
      public Kong()
      {
          super("Shazam");
  
      JPanel panel1 = new JPanel(new BorderLayout());
          panel1.add(textfield0,BorderLayout.CENTER);
          panel1.add(label0,BorderLayout.WEST);
      JPanel panel2 = new JPanel(new BorderLayout(10,10));
          panel2.add(btnon,BorderLayout.WEST);
          panel2.add(btnoff,BorderLayout.EAST);
      JPanel panel3 = new JPanel(new BorderLayout());
          panel3.add(textfield1,BorderLayout.CENTER);
          panel3.add(label1,BorderLayout.WEST);
  
  
  
      JPanel frame =  new JPanel(new BorderLayout(5,5));
          frame.add(panel1,BorderLayout.NORTH);
          frame.add(panel2,BorderLayout.EAST);
          frame.add(panel3,BorderLayout.SOUTH);
          setContentPane(frame);
      }
  
      public void actionPerformed(ActionEvent e)
      {
  
      }
  }
  </code></pre>