title: Instead of equal width, could elements in my GridLayout take only as much space as needed?
body: <p>I have such <code>JPanel</code>:</p>
  
  <pre><code>container = new JPanel();
  container.setLayout(new GridLayout(1, 1));
  </code></pre>
  
  <p>In this panel, I put <code>JLabel</code> and <code>JTextField</code> to create classical form. It renders like this:</p>
  
  <p><img src="https://i.stack.imgur.com/2vlRZ.png" alt="image description"></p>
  
  <p>Obviously, I'd prefer to have the first column shorter, specifically just as wide as necessary to fit all JLabels. Like this (mspaint figure):</p>
  
  <p><img src="https://i.stack.imgur.com/xaEYw.png" alt="image description"></p>
  
  <p>The gray dashed line indicates where the two columns are divided. What do you propose for this layout?</p>
  
  <p>Note that the second column may also contain check box, select box or some other form element.</p>