Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with JComboBox not dropping down if element count <= 3

Status
Not open for further replies.

tick

Programmer
Jul 31, 2001
4
HK
I'm having trouble getting a basic JComboBox control to drop down and display its contents for selection if its got 3 or less elements. If it contains 4 then it drops down as expected.

I say basic, as all i do is create the JComboBox by passing it a vector.

JComboLocation = new JComboBox(v);

it then just gets added to a gridbag layout;

buildConstraints(constraints,1,11,1,1,95,5);
gridBag.setConstraints(JComboLocation,constraints);
textPanel.add(JComboLocation);


The elements are in the combo. Giving the control focus and using the arrow keys cycles through the list content as you would expect.

Does anyone know why the combo box is displaying this behaviour, and how to fix it ?

Thanks

 
Should anyone ever be interested, I posted this question on forum.java.sun.com in the swing forum and got to the bottom of the problem eventually.

The strange behaviour was caused by mixing swing components ( the JComboBox ) with the basic awt applet class.

The problem went away when i switched to using the javax.swing.JApplet instead.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top