wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes combo box issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "combo box issues" Watch "combo box issues" New topic
Author

combo box issues

Rich Charlton
Greenhorn

Joined: Nov 11, 2004
Posts: 19
Hi all,

I have written a program with three combo boxes asking user to pick a date. I have one combo for day, one for month and one for year. My problem is that i have designed a for loop to make the numbers 1 to 31 appear in the combo box, although when you run the program you get a blank space where the number 1 should be. Is their way of setting the combo box so that one is shown first, instead of a blank box.

Program:

Any ideas ?

Thanks
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
setSelectedIndex(0)
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

No More Java Please

Welcome to Javaranch! We don't have too many rules around here but we do have a Naming Policy. Please read and adjust your display name to comform. You can change your display name here.

Thanks.


GenRocket - Experts at Building Test Data
Rich Charlton
Greenhorn

Joined: Nov 11, 2004
Posts: 19
Hi,

Thanks for taking a look, ive changed my name now hope thats cool.

As for the answer to my question..where do i put the setselectedindex(0);

Do you have any more clarification...

Thanks
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
it's a method on JComboBox. Look it up in the javadocs
Rich Charlton
Greenhorn

Joined: Nov 11, 2004
Posts: 19
Hi,

I looked it up and got it working. Never new about that specific method for JComboBox.

Many Thanks.

 
GeeCON Prague 2014
 
subject: combo box issues