我正在尝试创建一个在GUI其余部分左侧打开的面板。我在Eclipse中工作。我将swingx-core-1.6.2.jar添加到我的构建路径中。我可以导入org.jdesktop.swingx.JXCollapsiblePane,然后创建一个新的JXCollapsiblePane,但是为了设置窗格的方向,我需要执行如下操作:
JXCollapsiblePane myCollapsingPane = new JXCollapsiblePane();
mycollapsingPane.setOrientation(JXCollapsiblePane.Orientation.HORIZONTAL);然而,这是失败的,因为方向不能被解决。因此,我尝试导入org.jdesktop.swingx.JXCollapsiblePane.Orientation,但也失败了,因为它无法解决。我可能在这里遗漏了一些愚蠢的东西;我如何设置面板向一侧打开而不是垂直打开?
发布于 2012-07-19 04:54:23
1.6.2版本的JXCollapsiblePanel没有setOrientation方法。此外,还有JXCollapsiblePane.Orientation枚举。可能是掉了。
然而,有JXCollapsiblePane.Direction和JXCollapsiblePanel.setDirection(),它可能是一个替代品。
这里有一个关于这方面的thread。
https://stackoverflow.com/questions/11549693
复制相似问题