title: Placing multiple objects in a region of borderlayout
body: <p>I want to place more than one element in one region of BorderLayout. As suggest on various sites, I used 3 separate panels for 3 regions and placed 2 elements in different regions in each panel. However I did not get the desired result. This is my code:</p>
  
  <pre><code>public class Trial extends JFrame{
  JPanel p1,p2,p3;
  JLabel l1,l2,l3,l4,l5,l6;
  
  Trial(){
      p1=new JPanel();
      p2=new JPanel();
      p3=new JPanel();
      l1=new JLabel("Hello");
      l2=new JLabel("Hi");
      l3=new JLabel("Welcome");
      l4=new JLabel("Bye");
      l5=new JLabel("Visit again");
      l6=new JLabel("Thanks");
      p1.add(l1,BorderLayout.NORTH);
      p1.add(l2,BorderLayout.CENTER);
      p2.add(l3,BorderLayout.CENTER);
      p2.add(l4,BorderLayout.SOUTH);
      p3.add(l5,BorderLayout.NORTH);
      p3.add(l6,BorderLayout.SOUTH);
      add(p1,BorderLayout.NORTH);
      add(p2,BorderLayout.CENTER);
      add(p3,BorderLayout.SOUTH);
  }
  public static void main(String[] args){
      Trial t=new Trial();
      t.setSize(500,500);
      t.setVisible(true);
  }
  }
  </code></pre>
  
  <p>Could somebody please suggest me how to correct it?</p>