title: Java Swing and Netbeans GUI Designer: How to remove small gaps between components when I set them invisible?
body: <p>I am a newcomer to Java Swing. I am using the GUI builder of Netbeans.</p>
  
  <p>I have three main panels for three different views in my application. These views can be switched by a menu on the left.</p>
  
  <p>I switch these views by setting one visible and setting the other two invisible. It works but there is a little problem. </p>
  
  <p>In order to achieve this, I had to put three JScrollPanes next to each other horizontally in the GUI builder. Whenever I switch to a view, the small gaps between the visible component and the invisible ones remain when the visible JScrollPane resizes itself to fill the entire window. It makes the application look quite ugly. The same thing happens when I place them vertically.</p>
  
  <p>How can I fix this by using the GUI builder? I can't make changes to the code for the interface design, obviously.</p>
  
  <p>Here is a very crude drawing of the problem, I hope it's clear enough: <a href="http://img686.imageshack.us/img686/4640/gaps.gif" rel="noreferrer">Link</a></p>
  
  <p>Using only one JScrollPane is not an option, because they have different layout managers and will have lots and lots of components. It would not be feasible in terms of performance to render everything from the beginning when a user changes the view.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Emre</p>