问题
I have an SWT combo box in my GUI. Is it possible to check if the combo box has been opened? (I've a mechanism which refreshes the state shown in the combo box, when a user opens it sometimes it jumps between user selection and that what the algorithm thinks is fine, the user selection has a priority over everything else).
回答1:
Combo SWT component have method getListVisible()
which returns flag if combo dropdown list part is visible or not.. see documentation for combo for details.
回答2:
The response of Sorceror is about org.eclipse.swt.widgets.Combo
If you need this method on javax.swing.JComboBox
you can use isPopupVisible()
来源:https://stackoverflow.com/questions/14579847/how-to-check-if-the-swt-combo-is-currently-opened