JCombo自动完成 - 图案或反向查找 [英] JCombo AutoComplete - Pattern or Reverse Lookup
问题描述
我使用的<一个href=\"http://download.java.net/javadesktop/swinglabs/releases/0.8/docs/api/org/jdesktop/swingx/autocomplete/package-summary.html\">auto-complete装饰在swingx库:
AutoCompleteDecorator.decorate(myComboBox);
这是pretty甜蜜。但是,它只能从输入文本的开始向前搜索。
Which is pretty sweet. However, it only searches forward from the start of the typed text.
所以,如果我的组合包括:[苹果,香蕉,葡萄,橙]输入'一个'本着严谨的模式将不会显示任何结果。在非严格模式没有什么要么是搜索。我想它匹配'香蕉'和; 橙,因为这两个项目包含我键入的文字。
So if my combo contains: [Apple, Banana, Grape, Orange] typing 'an' in "strict" mode will not show any results. In non-strict mode nothing is searched either. I'd like it to match 'Banana' & 'Orange' since both items contain my typed text.
是否有任何自动完成库,允许这种类型的功能?我认为战略方法将工作最好在这里,但我没有找到任何适用的。我很好扩展现有的功能 - 只要我不重新发明轮子
Are there any auto-complete libraries that allow for this type of functionality? I would think a strategy approach would work best here, but I'm not finding anything applicable. I'm fine with extending existing functionality - so long as I'm not reinventing the wheel.
在此先感谢!
推荐答案
自动完成的的JComboBox
和的JTextField
和在这里你的要求,你可以设置严格的假/真自动完成的ComboBox / JFextField ,如果你想用code打那么这是很好的基础自动完成funcionalities为的JFormattedTextField
AutoComplete for JComboBox
and JTextField
and by your requirements here you can sets strict false/true Auto complete ComboBox / JFextField and if you'll want to play with code then that's good base for AutoComplete funcionalities for JFormattedTextField
这篇关于JCombo自动完成 - 图案或反向查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!