java - Is there a way to check if a ComboBox has any items in JavaFX? -


is there way check if combobox has items in or whether empty? have array of comboboxes , need go through each of them, if there no items in combobox, must hide it. following code doesn't seem work:

for (combobox cmb : comboboxes) {     if (cmb.getitems().isempty()) {         cmb.hide();     } } 

the .getitems() method returns observablelist<t> can check .size(). tell if it's empty.

for (combobox cmb : comboboxes) {   if (cmb.getitems().size() <= 0) { // or cmb.getitems().isempty()       cmb.setvisible(false); } } 

if combobox populated list of own, check if list empty same .size() call.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -