title: how to return the number when the button is clicked
body: <p>My question is when the number is get from the an arraylist, for example
  <code>JNumber.size()=10</code>;</p>
  
  <pre><code>    for(int a=0;a&lt;JNumber.size();a++)
      {
           btnNumber= new JNumber(""+(a+1));
           btnNumber.setPreferredSize(new Dimension(20, 10));
           panel.setLayout(new GridLayout(10,10));
           panel.add(btnNumber, BorderLayout.SOUTH);
      }
  </code></pre>
  
  <p>Then how to return the number when the button is clicked?</p>
  
  <blockquote>
    <p>Output:</p>
    
    <p>Number 2 is clicked.</p>
  </blockquote>