private void addSelectColumn() { headerCheckboxCol.setPrefWidth(40); headerCheckboxCol.setCellValueFactory(new PropertyValueFactory<>("selected")); headerCheckboxCol.setCellFactory(param -> buildCell()); headerCheckboxCol.setGraphic(headerColCheckbox); headerCheckboxCol.setVisible(false); tableView.getColumns().add(0, headerCheckboxCol); }
@SuppressWarnings({"unchecked"}) private void addSelectColumn() { headerCheckboxCol.setPrefWidth(40); headerCheckboxCol.setCellValueFactory(new PropertyValueFactory<>("selected")); headerCheckboxCol.setCellFactory(param -> buildCell()); headerCheckboxCol.setGraphic(headerColCheckbox); headerCheckboxCol.setVisible(false); tableView.getColumns().add(0, headerCheckboxCol); }
private void makeHeaderWrappable(TableColumn col) { Label label = new Label(col.getText()); label.setStyle("-fx-padding: 8px;"); label.setWrapText(true); label.setAlignment(Pos.CENTER); label.setTextAlignment(TextAlignment.CENTER); StackPane stack = new StackPane(); stack.getChildren().add(label); stack.prefWidthProperty().bind(col.widthProperty().subtract(5)); label.prefWidthProperty().bind(stack.prefWidthProperty()); col.setGraphic(stack); }
.forEach(fp -> { if (!fp.columnFilter.hasUnselections()) { fp.columnFilter.getTableColumn().setGraphic(null); } else { fp.columnFilter.getTableColumn().setGraphic(filterImageView.get()); if (!bumpedWidth) { fp.columnFilter.getTableColumn().setPrefWidth(columnFilter.getTableColumn().getWidth() + 20); columnFilter.getTableFilter().getColumnFilters().stream().forEach(cf -> cf.getTableColumn().setGraphic(null)); contextMenu.hide(); });
final Node graphic1 = new ImageView(new Image("file:src/helloworld/about_16.png")); lastNameCol = new TableColumn<Person, String>(); lastNameCol.setGraphic(graphic1); lastNameCol.setText("Last"); lastNameCol.setSortType(TableColumn.SortType.DESCENDING);