title: Add Jbutton to Jpanel
body: <p>can somebody tell me what is wrong with this code i am trying to add the buttons to my JPanel</p>
  
  <pre><code>ArrayList&lt;JButton&gt; buttons = new ArrayList&lt;JButton&gt;();
  
  JPanel createButtonspane(){
     bpanel = new JPanel();
     for(int i=0; i&lt;10; i++){
        buttons.add(new JButton(""+i));
        bpanel.add(buttons);
     }
     return bpanel;
  }
  </code></pre>