Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 JXTree 和 swingx 的可搜索界面执行搜索,但我找不到任何示例,而且我不知道它是如何工作的,因为我以前没有将它与任何其他 swingx 组件一起使用。
我要做的是:
tree.getSearchable().search("text to search")
但树内没有任何反应,我希望它过滤其内容以显示与搜索匹配的节点。
有什么例子吗?有什么提示吗?谢谢
根据 API,该方法不会过滤树,它只是:
“返回:匹配字符串的索引,如果找不到匹配,则返回 -1。”