package com.example; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; public class MainController { @FXML private TableView table; @FXML private TableColumn idCol; @FXML private TableColumn naemCol; @FXML private Button startButton; @FXML private void initialize() { idCol.setCellValueFactory(new PropertyValueFactory<>("id")); naemCol.setCellValueFactory(new PropertyValueFactory<>("name")); ObservableList data = FXCollections.observableArrayList(); data.add(new Employee(1, "name1")); data.add(new Employee(2, "name2")); data.add(new Employee(3, "name3")); data.add(new Employee(4, "name4")); table.setItems(data); startButton.disableProperty() .bind(table.getSelectionModel() .selectedItemProperty().isNull()); } @FXML void onClickStartButton(ActionEvent event) { } }