title: How to have Collapsable/Expandable JPanel in Java Swing
body: <p>I want a JPanel that can be Collapsed or Expanded when user clicks on a text/icon on its border. I need this type of panel due to space crunch in my application. </p>
  
  <p>I read about CollapsiblePanel class but not sure how to use it.. I think SwingX is needed to be downloaded but did not find that anywhere.</p>
  
  <p>Moreover, it would be better if I get the solution to this in basic Java Swing. </p>