如何让JComboBox下拉列表比JComboBox本身更宽 [英] How to have JComboBox drop down list which is wider than the JComboBox itself

查看:138
本文介绍了如何让JComboBox下拉列表比JComboBox本身更宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参考和 AjaxAutoCompleteJComboBox

解决方案

我通过以下论坛解决了我的问题 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆