JFrame Combo box Event Key… HELP

▼魔方 西西 提交于 2019-12-25 14:48:48

问题


I am having a problem on what to use and what to code if I want my combo box be generated once the user type a key...

like:

once i pressed letter "A" from keyboard inside the combo box, all items starting from letter "A" will show up from the drop down list.

How can I code this when:

items from the combo box came from my database and it's default value is the first item stored on my database.

Actually I don't have any idea how to code it. All I have was a template from JFrame.

Items from database were just drag to combo box and it automatically generate a class.

Please Help. Thanks in advance ^_^


回答1:


ok here is go two classes one for JComboBox and 2nd for JTextField (you are neede both) you can set for both if is strict (if Iten Exist) or not you can input any value as you wants here

much luck



来源:https://stackoverflow.com/questions/6386289/jframe-combo-box-event-key-help

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