如何在Java Swing中具有可折叠/可扩展JPanel [英] How to have Collapsable/Expandable JPanel in Java Swing

查看:344
本文介绍了如何在Java Swing中具有可折叠/可扩展JPanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个JPanel,当用户单击其边框上的文本/图标时,它可以折叠或展开.由于我的应用程序中空间有限,我需要这种类型的面板.

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.

我阅读了有关CollapsiblePanel类的信息,但不确定如何使用它.我认为需要下载SwingX,但找不到任何地方.

I read about CollapsiblePanel class but not sure how to use it.. I think SwingX is needed to be downloaded but did not find that anywhere.

此外,如果我在基本的Java Swing中获得解决方案,那就更好了.

Moreover, it would be better if I get the solution to this in basic Java Swing.

推荐答案

不确定您在哪里看,但也不难找到 -即使考虑到我们所处的基础设施混乱;-)

not sure where you looked, but it's not that difficult to find - even given the infrastructure mess we are in ;-)

转到 SwingX 的项目主页,然后单击第一段中的链接(至准系统)下载部分,直至发行版\ 1.6.2.对于可折叠对象本身没有什么特别的,只是用于将组件放入其中的容器.

Go to the project home of SwingX, then follow the link in the first paragraph to the (barebone) download section, down to releases\1.6.2. Nothing special to the collapsibles themselves, just containers to put components into.

这篇关于如何在Java Swing中具有可折叠/可扩展JPanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆