title: Creating rows and columns of JButtons
body: <p>I have been given a task to create 3 sets of seats, and each set has 3 rows and 10 columns of seats. Firstly to get started I created one seat each for the three sets and I'm now trying to use the layout manager to display the seats(which are <code>JButtons</code>) in the style 3x10. Here's the code I have: </p>
  
  <pre><code>public class ConcertPanel extends JPanel
  {
      private JPanel Panel1;
      private JButton goldSeat;
      private JButton silverSeat;
      private JButton bronzeSeat;
  
  
     ConcertPanel()
     {   
          Panel1 = new JPanel();
          Panel1.setSize(500,500);
  
                  setLayout(new GridLayout(rows, cols));
                  for(int i = 0; i &lt; rows; i++)
                  for(int j = 0; j &lt; cols; j++)
              {
                  goldSeat = new JButton();
                  silverSeat = new JButton();
                  bronzeSeat = new JButton();
                  add(new JButton());
              }
                  this.add(Panel1);
  
         }
  }
  </code></pre>
  
  <p>at the minute I'm just getting 30 buttons in the jpanel, where they are not in rows or columns? help :(</p>