I have this variable that I passed from one controller to another it's the username and the password and then I wanted to use them to make a SQL query but it's not working.
I am really really new with javafx and I have no idea how to correct this and I need it now for a project.
The variables t
and tot
contain the username and password that I passed from the first controller.
private String[] T = new String[2];
public void myFunctione(String text){
label.setText(text);
}
public void yFunctione(String text){
labele.setText(text);
}
@Override
public void initialize(URL location, ResourceBundle resources) {
System.out.print(label.getText());
System.out.print(labele.getText());
//(R) sql query in which I used label and labele
This is the code of the controller that displays the students table. What I did now is that I put the two variables "username" and "password" in the labels "label" and "labele" and I don't know why I can't insert the value of these labels in the SQL query.
public void viewStudents(ActionEvent e) throws IOException{
Stage primaryStage=new Stage();
FXMLLoader Loader= new FXMLLoader(getClass().getResource("ViewStudents.fxml"));
Parent root = Loader.load();
ViewStudents con = Loader.getController();
con.myFunctione(label1.getText());
con.yFunctione(label2.getText());
Scene scene = new Scene(root,808,400);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
}