简体   繁体   中英

How to load an enum populated ComboBox with no value selected

On Netbeans, I have a jDialog with a jComboBox populated from values coming from a Java Enumeration. I need the default value of the Combo Box to be blank at start (or null or whatever), this way forcing the user to choose for a valid option. I have "selectedIndex" set to -1 but still the default value is my first enumeration value. So how can I have my Combo Box load with no value selected?

Thank you very much for your help.

Cheers.

您需要按照此问题的答案中的建议删除并重新添加ItemListener。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM