aspose file tools*
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: 15286
    
    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 - A Test Data Generation Platform
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: combo box issues
 
Similar Threads
Pass by Value Problem
Getting JOprionPane to appear within the confines of JFrame
Show JPanel in another class HELP !!!!
Find source of button click
Problem with saving a state in calendar program.