title: Get rid of the gap between JPanels
body: <p>Here is my problem</p>
  
  <p><img src="https://i.stack.imgur.com/wQrDP.jpg" alt="enter image description here"></p>
  
  <p>How can I get rid of the gap from the inner rectangle box (it is actually the border of the middle JPanel)?</p>
  
  <p>The outter rectangle is a extends JCompoment. Inside it contains three <code>JPanel</code>s. Each of them use GridLayout. I even try to setHgap to a negative value in the big rectangle, but it doesn't change anything.</p>
  
  <p>Edit: Sorry the question is not clear. I do want the border, but I don't want the gap between the inner border and outer border. If there is no gap in between, the whole rectangle will represent a class diagram class.</p>