To set a JCheckBox is using setSelected method with a boolean condition. Which method do i use to get the boolean data out of the JCheckBox. Thanks
Asked
Active
Viewed 1.7k times
0
-
umm can you rephrase your question? _to get the method out_ ?? – COD3BOY May 10 '12 at 04:58
-
Did you mean to check if the JCheckbox is selected? if so use isSelected() – COD3BOY May 10 '12 at 05:03
-
Thank you very much..took me hours looking for the method. i thought it was like getSelected or getState. – The JAVA Noob May 10 '12 at 05:05
-
LOL :-) it happens, sometimes, there are always somethings meant for others to show you :-) – nIcE cOw May 10 '12 at 05:09
3 Answers
4
Did you mean to check if the JCheckbox is selected? if so use isSelected()
You can also use an ItemListener in case you want to get notified about the check and uncheck!

COD3BOY
- 11,964
- 1
- 38
- 56
3
isSelected() is the method you looking for, I guess. This will return false
if JCheckBox
is NOT Selected
and true
if Selected
.

nIcE cOw
- 24,468
- 7
- 50
- 143