Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Making <optgroup></optgroup> in Java

843807Sep 27 2009 — edited Sep 28 2009
Is it possible to implement this drop-down box in a Java Swing application? I kept searching for this from the web, but I cant find relevant info. I cant make the optgroup function in neither JComboBox nor JList. Tell me how to do it, if you have this experience.


Thanks in advance!

<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2009
Added on Sep 27 2009
7 comments
452 views