title: How to make GridLayout to respect columns setting?
body: <p>I had been trying to make gridlayout to give the same columns as i had specified in the code instead  i got  3 times  amount of my specification, any idea on why it is like this and how to solve this problem will be appreciated.</p>
  
  <p>I have an ArrayList of type string with size of 150 string object an each of string is a text on JButton and then the JButton added to a JPanel with gridLayout Manager i wanted to create 15 rows and 10 colomns.</p>
  
  <p>Here is the code</p>
  
  <pre><code>JPanel panel = new JPanel();
  Gridlayout gridlayout = new GridLayout();
  gridlayout.setRows(15);
  gridlayout.setColumns(10);
  gridlayout.setHgap(2);
  gridlayout.setVgap(6);
  panel.setLayout(gridlayout);
  // now arraylist of type string, each string on Jbutton
  for(ArrayList string: strings){
      panel.add(new JButton (string));
  }
  </code></pre>