lundi 29 juin 2015

Quick way to see if all checkboxes are unselected

I have a java JPanel with 16 JCheckBoxes and I am wanting to ensure that the user selects at least one before submitting the form. The only way I know to do this is a huge if statement that looks at the Boolean value of the "isSelected()" method, but this seems inefficient. So I was wondering if there was a faster to way to check if all of the boxes are unchecked.




Aucun commentaire:

Enregistrer un commentaire