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 think you can use a JSplitPane to tackle your problem. Utilizing the property to set the position of divider judiciously, you can achieve what you want.