How to select multiple checkBoxs?

Asked

Viewed 111 times

0

I have a loop for, in which I create a new checkBox every time it goes through the/loop routine. I am adding these "checks" inside an item of a treeTableView. I wanted to know, how could I mark all checks created.

How can I recover "the value (the checkbox)" to be able to select ?

the creation of the check is as follows:

 for (int y = 0; y < lista.size(); y++) {
        CheckBoxW checkBoxW = new CheckBoxW();
        item = new TreeItem<?>(gp, new HBox(checkBoxW, label));
    }

1 answer

1

The class Checkbox has the method setSelected(Boolean), with it you will manage to change the status. to recover the value of checkBox should use the following

      getTreeTableView().getTreeItem(i).getChildren()...

That way you’ll get through every item of Treetableview.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.