title: I'm having trouble with Java Layout
body: <p>This is my first GUI application and I'm having trouble making it look neat. I have tried several layouts and tinkered with them e.g flow, grid, border. When I run the program everything is just jumbled together. </p>
  
  <p>I would like it to look like: </p>
  
  <pre><code>Unloaded Measurement      |textfield| |textfield|
  Loaded Rider Measurement  |textField| |textfield|
  Loaded Bike Measurement   |textField| |Textfield|
  
                     |Button|
  _______________________________________________________________________________________
  
  Race Sag: |TextField|
  Free Sag: |TextField|
  Race Sag Notes: |       TextField         |
  Free Sag Notes: |       TextField         |
  </code></pre>
  
  <p>Here is a screenshot to help understand what my issue is:
  <img src="https://i.stack.imgur.com/rZ8mo.png" alt="Screenshot"></p>
  
  <p>The top is for user input and the bottom is calculated output. I hope that I have given enough details for some help with this. I really appreciate anyone that helps out!
  Here is my code:</p>
  
  <pre><code>import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.util.StringTokenizer;
  import javax.swing.JButton;
  import javax.swing.JFrame;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.JTextField;
  
  
  public class Main extends JFrame {
  
  private static final long serialVersionUID = 1L;
  private JPanel panel;
  private JLabel messageLabel;
  private JLabel messageLabel1;
  private JLabel messageLabel2;
  private JLabel raceSagLabel;
  private JLabel freeSagLabel;
  private JTextField wholeTextField;
  private JTextField wholeTextField1;
  private JTextField wholeTextField2;
  private JTextField fracTextField;
  private JTextField fracTextField1;
  private JTextField fracTextField2;
  private JTextField raceSagText;
  private JTextField freeSagText;
  private JTextField noteText;
  private JTextField noteText1;
  private JButton calcButton;
  private final int WINDOW_WIDTH = 575;
  private final int WINDOW_HEIGHT = 400;
  
  
  /*===============================================================================
      Project : test.java - SagCalculator
      Author  : Brian Green
      Date    : Jan 10, 2013
      Abstract:   
  
    ===============================================================================*/
  public static void main(String[] args) {
      @SuppressWarnings("unused")
      Main sc = new Main();
  }
  public Main(){
      setTitle("Rider Sag Calculator");
      setSize(WINDOW_WIDTH, WINDOW_HEIGHT); 
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      //setLayout();
      buildPanel();
      add(panel);
      setVisible(true);
  }
  private void buildPanel(){
      messageLabel = new JLabel("Enter Unloaded Stand Measurement");
      messageLabel1 = new JLabel("Enter Loaded with Rider Measurement");
      messageLabel2 = new JLabel("Enter Loaed without Rider Measurement");
      wholeTextField = new JTextField(3);
      fracTextField = new JTextField(3);
      wholeTextField1 = new JTextField(3);
      fracTextField1 = new JTextField(3);
      wholeTextField2 = new JTextField(3);
      fracTextField2 = new JTextField(3);
      calcButton = new JButton("Calculate");
      raceSagLabel = new JLabel("Race Sag: ");
      raceSagText = new JTextField(5);
      freeSagLabel = new JLabel("Free Sag: ");
      freeSagText = new JTextField(5);
      noteText = new JTextField(30);
      noteText1 = new JTextField(30);
  
      calcButton.addActionListener(new CalcButtonListener());
      panel = new JPanel();
  
      panel.add(messageLabel);
      panel.add(wholeTextField);
      panel.add(fracTextField);
      panel.add(messageLabel1);
      panel.add(wholeTextField1);
      panel.add(fracTextField1);
      panel.add(messageLabel2);
      panel.add(wholeTextField2);
      panel.add(fracTextField2);
      panel.add(calcButton);  
      panel.add(raceSagLabel);
      panel.add(raceSagText);
      panel.add(freeSagLabel);
      panel.add(freeSagText);
      panel.add(noteText);
      panel.add(noteText1);
  
  
  
  }
  </code></pre>
  
  <p>If for some reason you need to see more of the code, just let me know. I will be happy to provide it. Thanks for the help!</p>
  
  <p>I got this all worked out! I would like to say thanks to @trashgod for his suggestion:
  <img src="https://i.stack.imgur.com/q2U0t.png" alt="enter image description here"></p>