title: Get text if component is jlabel
body: <p>I have a LayeredPane2 with mant components such as jlabels, jbutton etc.
  I want to loop in the components and if the component is a Jlabel, get it's text.
  How can I do this? Here is my code so far: </p>
  
  <pre><code>   //search the components
     for (int j=0; j&lt;jLayeredPane2.getComponents().length; j++){
       //if it is a jlabel
       if ("class javax.swing.JLabel".equals(jLayeredPane2.getComponent(j).getClass().toString())){
          //HOW DO I GET THE LABEL TEXT??
       }
     }
  </code></pre>