问题
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