I currently have a row of JPanels that I add to a JFrame. I need these panels to be able to expand and collapse as to minimize the clutter on the JFrame.
Right now, I just create the JPanels and add them to the JFrame one at the time.
public void addFolderSearch(FolderSearchComp fsc) {
folderCompPanel.add(fsc, folderCompPanel.getComponentCount());
remake();
}
I've tried adding these FolderSearchComps (the JPanels) to a TitledPane and then adding the TitledPane to the JFrame, but the titledpane.setContent() wont take the JPanel as a parameter.
Is there any way to add a JPanel to a TitledPane and then adding that TitledPane to the JFrame?