Guest User

Untitled

a guest
Jan 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <TableView fx:id="timelineTable" VBox.vgrow="ALWAYS">
  2. <columns>
  3. <TableColumn fx:id="dateColumn" prefWidth="85.0" text="%timeline.date" />
  4. </columns>
  5. </TableView>
  6.  
  7. Callback<TableColumn<String, String>, TableCell<String, String>> cellFactory = new Callback<TableColumn<String, String>, TableCell<String, String>>() {
  8. @Override
  9. public TableCell call(final TableColumn<String, String> param) {
  10. final TableCell<String, String> cell = new TableCell<String, String>() {
  11.  
  12. final Button btn = new Button("Just Do It");
  13.  
  14. @Override
  15. public void updateItem(String item, boolean empty) {
  16. super.updateItem(item, empty);
  17. if (empty) {
  18. setGraphic(null);
  19. setText(null);
  20. } else {
  21. btn.setOnAction(event -> {
  22. // do something
  23. });
  24. setGraphic(btn);
  25. setText(null);
  26. }
  27. }
  28. };
  29. return cell;
  30. }
  31. };
Add Comment
Please, Sign In to add comment