How to add CheckBox's to a TableView in JavaFX

前端 未结 13 527
日久生厌
日久生厌 2020-11-30 00:32

In my Java Desktop Application I have a TableView in which I want to have a column with CheckBoxes.

I did find where this has been done http://www.jonathangiles.net/

13条回答
  •  暖寄归人
    2020-11-30 01:12

    Small and simple.

    row.setCellValueFactory(c -> new SimpleBooleanProperty(c.getValue().getIsDefault()));
    row.setCellFactory(tc -> new CheckBoxTableCell<>());

提交回复
热议问题