Handling wide content in a Combo Box

Posted by devon on April 22, 2012 in Java |

JComboBox works great when you need to offer a choice of “Thing one” or “Thing two”.

But what do you do when you need to offer a choice of:
“My super, fantastic, amazingly awesome, awesomely cool gadget” or
“My super, fantastic, amazingly awesome, awesomely cool widget“?


Using JComboBox forces you to choose between cutting off the text, leaving the user the unenviable task of trying to decide between “My super, fantastic, …” and “My super, fantastic, …”, or letting it expand to the widest value which completely trashes your elegant layout.

Here’s a third choice: WideComboBox. The dropdown will display wide enough for the user to make an informed selection, but the combo box itself still fits in your layout.

Copyright © 2011-2017 Experimental.Jar All rights reserved.
This site is using the Desk-Mess-Mine Child-Theme, v1.0.0, on top of
the Parent-Theme Desk Mess Mirrored, v2.5, from BuyNowShop.com