Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <TableView fx:id="timelineTable" VBox.vgrow="ALWAYS">
- <columns>
- <TableColumn fx:id="dateColumn" prefWidth="85.0" text="%timeline.date" />
- </columns>
- </TableView>
- Callback<TableColumn<String, String>, TableCell<String, String>> cellFactory = new Callback<TableColumn<String, String>, TableCell<String, String>>() {
- @Override
- public TableCell call(final TableColumn<String, String> param) {
- final TableCell<String, String> cell = new TableCell<String, String>() {
- final Button btn = new Button("Just Do It");
- @Override
- public void updateItem(String item, boolean empty) {
- super.updateItem(item, empty);
- if (empty) {
- setGraphic(null);
- setText(null);
- } else {
- btn.setOnAction(event -> {
- // do something
- });
- setGraphic(btn);
- setText(null);
- }
- }
- };
- return cell;
- }
- };
Add Comment
Please, Sign In to add comment