title: JButton in array wont update text
body: <p>I've created an array of buttons, added them to my frame and (inefficiently) created action listeners for each of them which open a JOptionPane to take an input and add it to a String array, yet the text on the array button does not update after the popup is closed, while a button not part of an array updates its text fine. </p>
  
  <p>The string array grabs the data from the JOptionPane fine, it just wont update the button's caption. </p>
  
  <p>In my full program I'm writing ar_str_vals to a .xml file, and it can properly save and load the array, and surprisingly the array buttons properly set their text but only at the beginning of my program. </p>
  
  <pre><code>package wtf;
  
      import javax.swing.JButton;
      import javax.swing.JFrame;
      import javax.swing.JOptionPane;
  
      public class Wtf extends JFrame{
          JButton[] ar_btn_vals = new JButton[2];
          String[] ar_str_vals = new String[2];
          public Wtf(){
          super("Title");
          setLayout(null);
          setSize(300, 300);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setVisible(true);
          constructor();
          actionlisteners();
          }
  
  public void constructor(){
      for (int x = 0;x&lt;=1;x++){
          ar_btn_vals[x] = new JButton();
          ar_btn_vals[x].setText(ar_str_vals[x]);
          ar_btn_vals[x].setBounds(5,(100 * x)+20, 100,40);
          ar_btn_vals[x].setVisible(true);
          add(ar_btn_vals[x]);
          System.out.println(ar_str_vals[x]);
      }
  
  }
  
  public void actionlisteners(){
      for (int x=0;x&lt;=1;x++){
          switch (x){
          case 0:
                  ar_btn_vals[0].addActionListener(new java.awt.event.ActionListener() {
                      public void actionPerformed(java.awt.event.ActionEvent evt) {
                          ar_btn_vals0ActionPerformed(evt);
                      }
                  });
              break;
              case 1:
                  ar_btn_vals[1].addActionListener(new java.awt.event.ActionListener() {
                      public void actionPerformed(java.awt.event.ActionEvent evt) {
                          ar_btn_vals1ActionPerformed(evt);
                      }
                  });
              break;
          }
      }
  }
  
  private void ar_btn_vals0ActionPerformed(java.awt.event.ActionEvent evt) {
      JFrame frm_val0change = new JFrame();
      String newval = JOptionPane.showInputDialog(frm_val0change, "Enter new Button 1 Value");
      ar_str_vals[0] = newval;  
      constructor();
  }
  
  private void ar_btn_vals1ActionPerformed(java.awt.event.ActionEvent evt) {
      JFrame frm_val1change = new JFrame();
      String newval = JOptionPane.showInputDialog(frm_val1change, "Enter new Button 2 Value");
      ar_str_vals[1] = newval;  
      constructor();
  }
  
  public static void main(String[] args) {
      Wtf frame = new Wtf();
  }
      }
  </code></pre>
  
  <p>I'm aware that this isn't as efficient as it could be, but I've got limited time to finish this and I have absolutely no idea why this isn't working properly. </p>
  
  <p>This is also my first time asking a question, so please have mercy if I've formatted anything wrong.</p>