如何让JComboBox下拉列表比JComboBox本身更宽 [英] How to have JComboBox drop down list which is wider than the JComboBox itself
问题描述
我通过以下论坛解决了我的问题 Oracle Java Swing论坛
为了将来参考,我提供了完整可行的源代码,对于任何有兴趣的人。
AjaxAutoCompleteJComboBox.java
By referring to the answer at Multi Columns Combo Box for Swing, I manage to implement a 3 multi columns JComboBox as follow.
However, this is not perfect. My intention is to have something without the horizontal scroll bar, as follow.
My question is, how can I have a JComboBox drop down list, which is wider than the JComboBox itself? I just want to get rid of the horizontal scroll bar. Yet, able to fit in 3 columns into a single list.
The source code are ResultSetCellRenderer and AjaxAutoCompleteJComboBox
I got my problem resolved through the following forum Oracle Java Swing Forum
For future reference, I include the complete workable source code, for anyone who are interested.
AjaxAutoCompleteJComboBox.java
这篇关于如何让JComboBox下拉列表比JComboBox本身更宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!