title: Swing: Which layout to use for a html table like behavior and how?
body: <p>I want to display a two column layout in swing, a text label on the left and a button on the right. 80% width to be allocated to label and 20% width to be allocated to the button. Also, the number of rows are dynamic.</p>
  
  <p>I have tried to use multiple layout managers, but none is working correctly. If I use the default layout, the label and the button move onto a single line if the applet is resized.
  If I use BorderLayout, the size of button becomes huge. </p>
  
  <p>Code snippet:</p>
  
  <pre><code>    this.contentPanel = new JPanel();
  for (String eachParam : paramArrayList) {
          JPanel pane = new JPanel();
          JLabel lbl = new JLabel(eachParam);
          JButton btn = new JButton();
          btn.addActionListener(this);
          btn.setText("Find");
          btn.setName(eachParam);
          pane.add(lbl);
          pane.add(btn);
          this.contentPanel.add(pane);
      }
  </code></pre>