Skip to Main Content

Java SE (Java Platform, Standard Edition)


For appeals, questions and feedback about Oracle Forums, please email Please ask technical questions in the appropriate category. Thank you!

How to widen the drop-down list in a JComboBox

843804Nov 11 2004 — edited Aug 27 2007
Is there some way to set the width of the drop-down list of a JComboBox? Note, this is not the same thing as setting the width of the JComboBox itself (vis-a-vis setBounds() or setSize()). I've got my JComboBox set as wide as possible, but the thing is the items in the list are dynamic and user defined, and there is no way to predict the width of the widest item. Does anyone know how to do this?

Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2007
Added on Nov 11 2004