title: Get text property from a Component
body: <p>I have a <code>JPanel</code> called <code>panelCreatePuzzle</code> with 100 <code>JButton</code>'s.
  I used </p>
  
  <pre><code>Component[] cells = panelCreatePuzzle.getComponents();
  </code></pre>
  
  <p>To get an array of all the buttons. Now I want to print the text of each button. I have no clue how to do this. I tried the following:</p>
  
  <pre><code>for (Component cell:cells){                   
      System.out.println(cell.toString());
  }
  </code></pre>
  
  <p>Which does print something containing the text:
  <code>javax.swing.JButton[,321,321,30x30(...),text=here is the text,defaultCapable=true]</code>
  I can of course extract it from this string, but is there a more direct way that just gives me the text without anything else?</p>