2011-08-24 72 views
3

最近IM工作的/ w的项目,该项目需要编辑的组合框...在开始我连着的动作监听蒙山,但它并没有工作...然后我开始寻找在文档侦听这似乎是适当的针对这种情况JCombo框搜索

我要创建这个

------------------------- 
a        //---------- Consider this as a combo box 
------------------------- 
a 
ab 
aba 
abca 
abdaa   

--------------------- 
ab        //---------- Consider this as a combo box 
--------------------- 
ab 
aba 
abca 
abdaa    //- Hints 

现在我感到有点困惑如何使用文档侦听与组合框,因为每一个地方JTextComponent附有它....请帮助。

+0

欢迎在此论坛 – mKorbel

+0

另请参阅此[问题](http://stackoverflow.com/questions/6478577/how-to-make-a-text-field-for-searchingwith-tips-like-a-google -search/6479302#6479302)。 – trashgod

回答

1

下面是你在找什么的实现:Searchable JComboBox

+0

给点办法,但请给这一个尝试...它的工作,但创造了不少问题.....在写的字消失......而且刷新率退出可见,搜索不严格.... – greatmajestics