In my program, I want to uncheck all the checkboxes whenever this method is called. Can someone explain why it isn\'t working? Whenever I call this method the checkboxes are
In general in Swing any change made in the backend is not propagated to the visual elements. One good known exception is JTextField.setText() (any call to setText will update the visual text element immediatly).
It is even documented in the API doc: http://docs.oracle.com/javase/6/docs/api/javax/swing/AbstractButton.html#setSelected(boolean).
You may stay with your code but then you have to (in)validate the container.