title: how to populate text field with a selection from a JComboBox in java GUI
body: <p>I am new to java GUI I'm having trouble filling text field
  using a JComboBox data from a text file 
  text files has multiple rooms with the following format </p>
  
  <p>accountNumber &lt;> customerName &lt;> balance</p>
  
  <p>when an account number is selected from the combo for the 
  right name and balance need to populate on the text field
  so far I have a class called AccountUtility which reads the data
  from the text file I am using an ArrayList to populate the combo box 
  and a hashmap to map all names and balances
  so far I am only able to populate the combo box 
  I'm having problems filling in the text file 
  any help and suggestions are really appreciated </p>
  
  <pre><code> //class that reads text file//////
   public class AccountUtility {
      ArrayList&lt;String&gt; test = new ArrayList&lt;String&gt;();
      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
      String[] number;
      String columns[], accountNumber, customerName,balance;
      int size;
  
  
  public AccountUtility(){
  
  
      BufferedReader in = null;
      try{    // assume products.txt already exists
      in = new BufferedReader(new FileReader("accounts.txt"));
      String line = in.readLine();
      while(line != null)  {
      columns = line.split("&lt;&gt;");
      accountNumber = columns[0];
      customerName = columns[1];
      balance = columns[2];
  
      test.add(accountNumber);
      map.put(customerName, balance);
  
  
                      line = in.readLine();
              }
              in.close();
      }
      catch(IOException ioe)
      {
              System.out.println(ioe);
      }
  } 
   public ArrayList&lt;String&gt; getAccountNumbers( ){
       return test;
  }
  public HashMap&lt;String, String&gt; getMap(){
      return map;
  }
  
  
  
  
  //method on main class that populates JComboBox
      public AccountApp() {
  
          initComponents();
          setLocationRelativeTo(null);
  
          // Populate JComboBox
          AccountUtility gc = new AccountUtility();
          for( String one : gc.getAccountNumbers()){ 
          accountNumberComboBox.addItem(one);
          }
      }
  </code></pre>
  
  <p>This is what the GUI looks so far</p>
  
  <p><a href="https://i.stack.imgur.com/hjgEj.png" rel="nofollow noreferrer">enter image description here</a></p>