title: Java Swing: Choosing the correct LayoutManager
body: <p>I'm building a PropertyPanel. Currently I'm using a <code>GridLayout</code> to manage the <code>JLabels</code> and their corresponding fields where I can specify the value. But the problem is that the <code>GridLayout</code> automatically manages the size of the columns: it makes them the same width.</p>
  
  <p>This means when I'm having a big value field, the colum, is getting bigger (which is good), but the other column (with all my <code>JLabel</code>s) is getting bigger as well. Here is a screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/w2MUC.png" alt="enter image description here"> &nbsp; &nbsp; <strong>&lt; BAD</strong></p>
  
  <p>As you can see, the <code>image</code> property has a huge value, which makes both columns bigger, and I'm having a lot of space after the <code>JLabel</code>s.</p>
  
  <p>So, I'm searching for a <code>LayoutManager</code> which makes each column as big as necessary.<br>
  I want a layout like this (it's edited with Gimp):</p>
  
  <p><img src="https://i.stack.imgur.com/gCi89.png" alt="enter image description here"> &nbsp; &nbsp; <strong>&lt; GOOD</strong></p>
  
  <p>Thanks</p>