| Author |
question about jcheckbox
|
Kevin Pang
Ranch Hand
Joined: Mar 01, 2005
Posts: 38
|
|
how to achieve the "check all" function and get the value from all jcheckbox checked ? how to do the function in swing as in javascript getElementById() ?
thanks.
|
 |
Kevin Pang
Ranch Hand
Joined: Mar 01, 2005
Posts: 38
|
|
solved
Container c = jck.getParent();
Component[] comps = c.getComponents();
for (Component comp : comps) {
if (comp instanceof JCheckBox) {
if (((JCheckBox) comp).isSelected()) {
rsltInfor.append(((JCheckBox) comp).getText() + " ");
}
}
}
|
 |
 |
|
|
subject: question about jcheckbox
|
|
|