Search code examples
javaswinguser-interfaceswingx

Java SwingX Setup and use of JXCollapsiblePanel


I am trying to create a panel which opens to the left of the rest of my GUI. I am working in Eclipse. I added swingx-core-1.6.2.jar to my build path. I can import org.jdesktop.swingx.JXCollapsiblePane and then make a new JXCollapsiblePane, but in order to set the orientation of the pane, I need to do something like:

JXCollapsiblePane myCollapsingPane = new JXCollapsiblePane();
mycollapsingPane.setOrientation(JXCollapsiblePane.Orientation.HORIZONTAL);

However, this fails saying that Orientation cannot be resolved. So, I tried importing org.jdesktop.swingx.JXCollapsiblePane.Orientation, which also fails saying that it cannot be resolved. I'm probably missing something silly here; how do I set the panel to open to the side rather than vertically?


Solution

  • JXCollapsiblePanel at 1.6.2 has no setOrientation method. Also, there is JXCollapsiblePane.Orientation enum any more. It was probably dropped.

    However, there is JXCollapsiblePane.Direction and there JXCollapsiblePanel.setDirection(), it is probably a replacement.

    Here is a thread about this.