title: Java - JButton text disappears if actionPerformed defined afterwards
body: <p>This has been bugging me for a while.  If I define <code>setText</code> on a JButton <em>before</em> defining <code>setAction</code>, the text disappears:</p>
  
  <pre><code>JButton test = new JButton();
  test.setText("test");  // Before - disappears!
  test.setAction(new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
          // do something
      }
  });
  this.add(test);
  </code></pre>
  
  <p>If it's <em>after</em>, no problems.</p>
  
  <pre><code>JButton test = new JButton();
  test.setAction(new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
          // do something
      }
  });
  test.setText("test");  // After - no problem!
  this.add(test);
  </code></pre>
  
  <p>Furthermore, if I set the text in the JButton constructor, it's fine! Yarghh!</p>
  
  <p>Why does this happen?</p>