JFrame组合框事件键...帮助 [英] JFrame Combo box Event Key... HELP
问题描述
如果我希望用户一旦输入密钥就生成我的组合框,则我在使用什么以及编写什么代码方面遇到问题.
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...
喜欢:
一旦我从组合框内的键盘上按了字母"A",所有从字母"A"开始的项目都会从下拉列表中显示.
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.
实际上,我不知道如何编写代码.我所拥有的只是来自JFrame的模板.
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 ^_^
推荐答案
好的,这里有两个类,一个用于JComboBox,第二个用于JTextField(两者都需要) 您可以同时设置是否严格(如果Iten存在),也可以根据需要输入任意值
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
好运
这篇关于JFrame组合框事件键...帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!