title: Setting panel at center of screen by using layout
body: <p>I tried setting the position of child-panel at the center of parent-panel by using</p>
  
  <pre><code>parent_panel.setLayout(new BorderLayout());
  parent_panel.add(child_panel, BorderLayout.CENTER);
  </code></pre>
  
  <p>But it's getting added at the middle of horizontal screen but vertically at top.</p>
  
  <p>What do I need to do to add it at center of screen vertically and horizontally? </p>