JXTaskPane 在启动时折叠时展开
我在将 JXTaskPane 添加到 JPanel 时发生了奇怪的行为。
JXTaskPane 具有多个(可扩展)图标部分的列表,然后将其添加到 JXTaskPaneContainer。
然后,taskPaneContainer 将被添加到 JPanel 中。
该 JPanel 被添加到 JTabbedPane 中。
当程序启动并且(第二个)选项卡被 setSelectedComponent 时,带有图标部分列表(在容器内)的任务窗格在显示折叠之前会短暂地展开(带有滚动条)。我正在努力消除这种滋扰行为。
为什么它在显示为其设置的折叠状态之前会短暂显示为展开状态?
I have a strange behavior happening with a JXTaskPane added to a JPanel.
The JXTaskPane has lists of multiple (expandable) sections of icons and then it is added to JXTaskPaneContainer.
The taskPaneContainer is then added to the JPanel.
This JPanel is added to a JTabbedPane.
When the program starts and that (2nd) tab is setSelectedComponent, that TaskPane with the list of icon sections (inside the container) flashes briefly expanded (with scroll bar) before it displays collapsed. Its nuissance behavior that I am trying to eliminate.
Why does it show expanded briefly before it displays to its set collapsed state?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在使用 JXTaskPane 时遇到了同样的事情。我查看了 swingx 的源代码,发现 JXTaskPane 内部使用了 JXColapsiblePane,默认情况下是展开的。
当您在创建 JXTaskPane 时调用 setColapsed(true) 时,它会触发一个 propertyChange 事件,该事件将在组件第一次显示时处理,这解释了我们在这里看到的奇怪行为。
I am experiencing the same thing with a JXTaskPane. I have looked at the source code of swingx and saw that the JXTaskPane uses a JXColapsiblePane internally wich is expanded by default.
When you call setColapsed(true) as you create your JXTaskPane, it fires a propertyChange event that will be processed the first time the component is displayed, this explains the strange behaviour we see here.