I want to get one selected model with name, author,key_words to next window. Where it will be in tex fields. After i changing this, i want to save it in database by SQL Update command
public void displaySelected(ActionEvent mouseEvent) {
ModelTable selection = Table_View.getSelectionModel().getSelectedItem();
if (selection == null){
System.out.println("not selected");
}else {
String SelectedAuthor = selection.getAuthor();
String SelectedName = selection.getName();
String SelectionWord = selection.getWords();
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("Admin_Change.fxml"));
try {
loader.load();
} catch (IOException e) {
e.printStackTrace();
}
Change_Add_Button.getScene().getWindow().hide();
Parent root = loader.getRoot();
Stage stage = new Stage();
stage.setScene(new Scene(root));
stage.show();
System.out.println("Change display");
}
}
I want to set text field from selected item to new page to Controller_Admin_Change
@FXML
private TextField Change_AdminEdit_Author;
@FXML
private TextField Change_AdminEdit_Name;
@FXML
private TextField Change_AdminEdit_Word;
Maybe its common mistake of OOP, but idk how to find a solution Thanks for advice
Selected item what i what to insert From this
to this fields To this