typeable JComboBox

一笑奈何 提交于 2020-02-04 04:05:07

问题


I am sure this has been asked but I can't find it (maybe I don't know how to search for it).

I have a JComboBox with lots of values, so navigating through all of them is painful. I would like it to change its selection the way browsers do: when you type the first letter, say s, it would select the first element starting with s, then if you quickly type the second letter, say a, the selection would change to the first element starting with sa, and so on.

Just a transparent, "typeable" JComboBox, not a JTextField where you start typing then a pull-down of options shows up.


回答1:


  • have look at AutoComplete JComboBox / JTextField

  • another choice is decorator by SwingX



来源:https://stackoverflow.com/questions/12042048/typeable-jcombobox

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