@FXML private void handleDeleteTitle() { int selectedIndex = progsTable.getSelectionModel().getSelectedIndex(); if (selectedIndex >= 0) { progsTable.getItems().remove(selectedIndex); } else { // nothing selected alert = new Alert(AlertType.WARNING); alert.initOwner(mainApp.getPrimaryStage()); alert.setTitle("No Selection"); alert.setHeaderText("No Title Selected"); alert.setContentText("Please select a Title in the table"); alert.showAndWait(); } }
@FXML private void handleEditTitle() { Programs selectedTitle = progsTable.getSelectionModel().getSelectedItem(); if (selectedTitle != null) { boolean okClicked = mainApp.showProgramsEditDialog(selectedTitle); if (okClicked) { showProgramsDetails(selectedTitle); } } else { // Nothing selected. Alert alert = new Alert(AlertType.ERROR); alert.initOwner(mainApp.getPrimaryStage()); alert.setTitle("No Selection"); alert.setHeaderText("No Title Selected!"); alert.setContentText("Please select a Title in the table!"); alert.showAndWait(); } }