Java 1.5 过滤器 JTable

发布于 2024-08-01 23:33:06 字数 88 浏览 0 评论 0原文

我想过滤 JTable 中的一些行,但 google 找到的所有内容都是针对 java 1.6 的。 我想使用 java 1.5 来执行此操作,因为我无法升级?

I would like to filter some rows in a JTable but all the stuff google found me is for java 1.6. I would like to do this using java 1.5 since i can not upgrade?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌化 2024-08-08 23:33:06

我还没有使用过它们(我很幸运能够使用 1.6),但你可以尝试 Glazed Lists。 好像1.5也能用。

I haven't used them (I'm lucky enough to be using 1.6) but you could try Glazed Lists. It seems to work with 1.5.

掐死时间 2024-08-08 23:33:06

您应该能够使用 SwingX 库来完成此操作:

例如,

Filter[] filterArray = { new PatternFilter("(.*1st.*)|(.*Final.*)", 0, 0) };
FilterPipeline filters = new FilterPipeline(filterArray);
table.setFilters(filters);

这里有一篇关于此的文章:

http://www.javalobby.org/java/forums/t18819.html

您可以使用 FilterPipeline 将各种过滤器链接在一起,并且有一堆可以使用的内置过滤器(ShufflerSorter、PatternFilter)。

它应该可以为您提供所需的内容,而无需诉诸 Java 6 升级。

You should be able to use the SwingX library to accomplish this:

e.g.

Filter[] filterArray = { new PatternFilter("(.*1st.*)|(.*Final.*)", 0, 0) };
FilterPipeline filters = new FilterPipeline(filterArray);
table.setFilters(filters);

There's an article here on this:

http://www.javalobby.org/java/forums/t18819.html

You can chain various filters together using the FilterPipeline and there's a bunch of built in filters that can be used (ShufflerSorter, PatternFilter).

It should provide you with what you need without resorting to a Java 6 upgrade.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文