permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets 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() + " ");

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