This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes setting initial value of combobox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "setting initial value of combobox" Watch "setting initial value of combobox" New topic

setting initial value of combobox

Anthony Leroy

Joined: Aug 02, 2001
Posts: 20
is there a way to set the initial value of a combobox in a form? Let's say a combo box has 3 options: optA, optB and optC, in that order. Ordinarily, optA will be the default selected option. How can I make optC be the displayed option without rearranging the order of the options.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

g'day also,
Are we talking select boxes?

Add the word 'SELECTED' next to the option

will select optC without changing the order.
I agree. Here's the link:
subject: setting initial value of combobox
Similar Threads
combo box
question on editable combobox on Swing
Need help on right or left shifting Multiple selected options
Select value
Populating a combobox dinamically from a database