是否存在 Swing 可过滤 JList 组件?
对于特定屏幕,我正在寻找可以过滤的 JList
(与使用 RowFilter
过滤 JTable
的方式相同)
在野外的任何地方是否有这种组件的良好实现(您有使用它的经验)还是我必须自己编写代码?
(这不是那么长的事情,但如果有任何有效的实现,我会很乐意使用它)
For a specific screen, I'm looking for a JList
that I could filter (the same way you can filter a JTable
using a RowFilter
)
Is there a good implementation of this kind of component anywhere here in the wild (and do you have an experience with it) or do I have to code it myself ?
(it is not that long to do, but if there is any valid implementation, I would be happy to use it)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,我确信 SwingX 组件提供了这一点。查看 JXList。
您可以从此处获取 SwingX。
Yes, I'm sure that the SwingX components provide this. Check out JXList.
You can get SwingX from here.
您可以考虑使用单列
JTable
而不是JList
。如果您遵循此方法,您将免费获得过滤和排序(前提是您使用的是 JDK 6)。You could consider using a single column
JTable
instead of aJList
. If you follow this approach you'll get filtering and sorting for free (providing you're using JDK 6).恕我直言,glazedlists 应该对 JTable、JList 和 JComboBox 进行过滤和排序。
IMHO glazedlists should do filtering as well as sorting for JTable, JList and JComboBox.