The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

JComboBox

Posted by Chris Sanders on October 05, 2000 at 7:14 PM

I am wondering the correct method to change the content of a JComboBox. Currently I initialize the JComboBox with a Vector. Throuhout the life of the box I wish to change the content.
By using v.clear(); then add my new content to the vector
with v.add(); calls.

Most of time this works fine however occasionally when the
combo box is pulled down the #1. The verticle scroll bar is
missing. #2. Anything I click on will choose the bottom item
in the list. The next time it is pulled down all is fine again.
#3.Using the arrow keys instead of clicking with
the mouse causes the scroll bars to reappear and all is fine.

So am I doing something wrong? Missing a step?
Note: I have tried multiple layout managers and have come to the conclusion that the symptom is in the List portion of the
JComboBox.

Thanks,

Chris Sanders





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us