How to have Collapsable/Expandable JPanel in Java Swing
问题 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. 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. Moreover, it would be better if I get the solution to this in basic Java Swing. 回答1: not sure where you looked, but it's not that difficult to find - even given the infrastructure mess we are in ;