I have a project login system
Main Scene: CMainWallet.java
@FXML private Label status;
@FXML private Label version;
@FXML public TextField user;
@FXML public TextField pass;
@FXML private Button login;
@FXML private Button exit;
@FXML
public void loginWallet(ActionEvent event) {
String u = user.getText();
String p = pass.getText();
LoginModel loginModel = new LoginModel();
if (loginModel.validationLogin(u, p)) {
Stage stage = new Stage();
try {
Parent root = FXMLLoader.load(getClass().getResource("dashboard/Dashboard.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("Wallet Dashboard");
stage.show();
login.getScene().getWindow().hide();
} catch(Exception e) {
e.printStackTrace();
}
} else {
status.setText("Maaf Akun anda salah, Coba ulang lagi");
}
}
Dashboard.java
@FXML Label user;
@Override
public void initialize(URL url, ResourceBundle rb) {
CMainWallet main = new CMainWallet();
user.setText("Hello "+main.user.getText());
}
And i want to get to take string textfied, in the CMainWallet.java Where is my mistake on code, is there any solution on my code
Thanks :D