I am working with a form, which has several textFields that I want to fill by taking the data from another window, the window from which I want to take the data I open it by clicking on an icon that is located next to the textField
The second window I open when I click on the book that is on the left side of the textField Provider, in which I only have one tableView and a "search engine"
from which I want to bring the provider's name to me by clicking on the record in the table, and that in turn the second window is closed
This is the code I have when I click on the icon:
@FXML
void seleccionarProveedor(MouseEvent event) {
try {
Stage proveedores = new Stage();
FXMLLoader loader = new FXMLLoader();
AnchorPane root = (AnchorPane)loader.load(getClass().getResource("/interfaces/seleccionarProveedor.fxml"));
Scene scene = new Scene(root);
proveedores.setScene(scene);
proveedores.alwaysOnTopProperty();
proveedores.initModality(Modality.APPLICATION_MODAL);
proveedores.show();
} catch (IOException ex) {
Logger.getLogger(InicioController.class.getName()).log(Level.SEVERE, null, ex);
}
}
And this one that I have when I click on any record in the table that is in the second window:
@FXML
void seleccionarProveedor(MouseEvent event) {
String nombreProveedor = tblData.getSelectionModel().getSelectedItem().getNombre();
}
It is the first time that I do an application with interface. I still do not quite understand the view controller mode that JavaFx handles.