I have a swing GUI, I'm trying to get my GUI to close if a certain requirement is met only if the checkbox is checked
JCheckBox C1 = new JCheckBox("checkbox 1"); 
so the code should be something like 
if(Jcheckbox is pressed) //do something
if that makes sense