title: Java (vertical) resize random gaps
body: <p>I have following code:</p>
  
  <pre><code>public Frame() {
      super();
      setVisible(true);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      setLayout(new GridLayout(0, 3));
      for (int i = 0; i &lt; 30; i++) {
          add(new JLabel("label"));
      }
  
  }
  </code></pre>
  
  <p>All this works perfectly fine, untill you start vertically resizing the frame.<br>
  For some reason it creates a gap above and under the labels that grows and shrinks again when enlarging the frame.<br></p>
  
  <p>This is most notable by looking at the top-line of labels that keep going up and down when you pull the underside of the frame further down.<br></p>
  
  <p>For clarifcation, <a href="https://dl.dropboxusercontent.com/u/46260502/24-03-2014%2011-45-56.jpg" rel="nofollow">these are the problem areas</a>.<br>
  The two areas in red are also filled while i want them to be empty.</p>
  
  <p>Any idea how to get rid of this empty space?<br>
  Thanks</p>