You can use
boolean isMyComboBoxEmpty = myComboBox.getSelectionModel().isEmpty();
Which also works, if you have a null
item among the ComboBox
items.
于是我找到了一个简单的方法:
boolean isMyComboBoxEmpty = (myComboBox.getValue() == null);
!(cmbDia.getValue()==null) && !(cmbMes.getValue()==null) && !(cmbAno.getValue()==null)//fue todo gracias :)
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.