JCombo AutoComplete - Pattern or Reverse Lookup

不问归期 提交于 2019-12-10 13:26:04

问题


I'm using the auto-complete decorator in the swingx library:

AutoCompleteDecorator.decorate( myComboBox );

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.

Thanks in advance!


回答1:


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



来源:https://stackoverflow.com/questions/6020769/jcombo-autocomplete-pattern-or-reverse-lookup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!