title: Use BorderLayout to create two even columns
body: <p>I'm trying to create a program using BorderLayout() that I want to look like this (but with even left right height and such)</p>
  
  <p><img src="https://i.stack.imgur.com/yvVxX.png" alt="enter image description here"></p>
  
  <p>although I am having trouble resizing the two JPanels (two boxes within the large box). At the moment my GUI looks like this,</p>
  
  <p><img src="https://i.stack.imgur.com/VYFMn.png" alt="enter image description here"></p>
  
  <p>I believe it is due to the CENTER still being there, I looked up on how to remove it but could not get it to work,</p>
  
  <p><strong>Question</strong></p>
  
  <p>Can can I edit this so that it will look like the top image.</p>
  
  <pre><code>package fuelstation;
  import java.awt.*;
  import java.util.*;
  import javax.swing.*;
  
  
  public class Fuelstation extends JFrame {
  
  
      JButton btn1 = new JButton("Random Button");
  
  
      public Fuelstation() {
          JFrame frame = new JFrame("Fuel Station");
          frame.setLayout(new BorderLayout());
          frame.setResizable(false);
          frame.setPreferredSize(new Dimension(500,350));
          frame.setMaximumSize(new Dimension(500,350));
  
  //        Left Hand Side
          JPanel lhs = new JPanel();
          JTextArea tf_list = new JTextArea();
          tf_list.setEditable(false);
          tf_list.setWrapStyleWord(true);
          tf_list.setText("This is a list of items");
          lhs.add(tf_list);
          tf_list.setSize(245, 325);
          lhs.setBorder(BorderFactory.createTitledBorder("Left"));
  //        Left Hand Side End
  
  
  //        Right Hand Side
          JPanel rhs = new JPanel();
          rhs.setAlignmentX(Component.CENTER_ALIGNMENT);
          rhs.setBorder(BorderFactory.createTitledBorder("Right"));
          rhs.add(btn1);
          tf_list.setSize(245, 325);
  
          JPanel center = new JPanel();
          center.setSize(0, 0);
  //        Right Hand Side End
  
          frame.add(lhs, BorderLayout.WEST);
          frame.add(center, BorderLayout.CENTER);
          frame.add(rhs, BorderLayout.EAST);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.pack();
          frame.setVisible(true);
  
      }
  
      public static void main(String[] args) {
          Fuelstation gui = new Fuelstation();
      }
  
  }
  </code></pre>