title: Adding Values From Combobox To Textfields
body: <p>I have a login form consisting of four fields as <strong>servername, portnumber, username, password</strong></p>
  
  <p>I have a combo-box besides that login form that should enable users to choose the last successful username (e-mail address) to be able to fetch values <strong>(servername, portnumber, username, password)</strong> into my text fields. I'm done with having that username in the combo-box.</p>
  
  <p>I need to put values regarding that username into my four textfields once the user choose the username in the combo-box. I need help about being able to formulate that actionListener and Performed functions. I'm not exactly sure of the ones all the way down below. Any help would be appreciated. THANKS!!</p>
  
  <pre><code>//Two lines down below, those are my values that I want to assign to its respective text field
  
  String user_name, server_name, port_number; // I have got the values
  Char [] password; // I have got its value
  
  
  JTextField serverText, portText, usernameText; // Those are my JTextField names to set values in it
  JTextField passwordText;
  
  
      final JComboBox&lt;String&gt; comboBox = new JComboBox&lt;String&gt;();
      comboBox.addItem(user_name); // Putting that username in the combo-box
      comboBox.setBounds(500, -13, 230, 70);
      panel.add(comboBox);
  
      comboBox.addActionListener(new ActionListener() {
  
          public void actionPerformed(ActionEvent event){
  
              procedure = (String) comboBox.getSelectedItem();
              private void itemStateChanged(ItemEvent e) {
                  if(e.getStateChange()) == ItemEvent.SELECTED){
                      usernameText.setText(user_name);
                 .......
                  }
  
        }
          }
  });
  </code></pre>