I use JcomboBox as a suggestion box that when user type in, it check for matches and display suggestion. Here is how I create the JComboBox:
Vector<String> popUpVector = new Vector<String>();
JComboBox jcb = new JComboBox(popUpVector);
every time Key Listener catch event, I do this
popUpVector.clear();
jcb.hidhPopUp();
for(String s : database){
popUpVector.add(s);
}
jcb.showPopUp();
It works as long as I don't select item from the dropdown. However, once I select item from the dropdown, the dropDown will display blank afterward, I check the popUpVector, it is not empty though, I think it has something to do with the selection, so I unhook it from actionListener, it didn't helps.
Can anyone help me with this, thanks a lot!