Originally posted by deepa sabbani:
but how to save the state of the check box.
Easiest way to display a Dialog is use the appropriate JOptionPane.showXXX method.
These methods, among other parameters, accept "Object message".
Construct a JPanel, put your check box and other stuff you require inside that panel, and use the panel as the message Object. If you keep on referencing the same panel instance, the check box state will be always retained.