Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have JComboBox drop down list which is wider than the JComboBox itself

Tags:

java

swing

By referring to the answer at Multi Columns Combo Box for Swing, I manage to implement a 3 multi columns JComboBox as follow.

alt text

However, this is not perfect. My intention is to have something without the horizontal scroll bar, as follow. alt text

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

like image 951
Cheok Yan Cheng Avatar asked Oct 19 '10 15:10

Cheok Yan Cheng


1 Answers

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

like image 134
Cheok Yan Cheng Avatar answered Sep 28 '22 04:09

Cheok Yan Cheng