@@ -0,0 +1,1237 @@
+package bcgTree.gui;%0A%0Aimport java.awt.BorderLayout;%0Aimport java.awt.Component;%0A%0Aimport javax.swing.Action;%0Aimport javax.swing.JButton;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.UIManager;%0A%0Aimport org.jdesktop.swingx.JXCollapsiblePane;%0A%0Apublic class Accordion extends JPanel %7B%0A%09private static final long serialVersionUID = 1L;%0A%09private String title;%0A%09private Component comp;%0A%0A%09public Accordion(String title, Component comp)%7B%0A%09%09this.title = title;%0A%09%09this.comp = comp;%0A%09%09initGUI();%0A%09%7D%0A%09%0A%09private void initGUI()%7B%0A%09%09this.setLayout(new BorderLayout());%0A%09%09JXCollapsiblePane collapsiblePane = new JXCollapsiblePane();%0A%09%09collapsiblePane.add(comp);%0A%09%09// get the built-in toggle action%0A%09%09Action toggleAction = collapsiblePane.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION);%0A%09%09// use the collapse/expand icons from the JTree UI%0A%09%09toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager.getIcon(%22Tree.expandedIcon%22));%0A%09%09toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager.getIcon(%22Tree.collapsedIcon%22));%0A%09%09JButton col = new JButton(collapsiblePane.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION));%0A%09%09col.setText(this.title);%0A%09%09this.add(col, BorderLayout.NORTH);%0A%09%09this.add(collapsiblePane, BorderLayout.CENTER);%0A%09%7D%0A%7D%0A

Add Accordion as GUI element