aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes  question about jcheckbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark " question about jcheckbox" Watch " question about jcheckbox" New topic

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() ?
Kevin Pang
Ranch Hand

Joined: Mar 01, 2005
Posts: 38
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() + " ");

I agree. Here's the link:
subject: question about jcheckbox
Similar Threads
Adding Button and check box in JTable
JFrame n JTabbedPane and Panel Very Urgent
JTable - JCheckBox
HELLP! i cant get 2 JPanels to display without them sitting on the other!