I have a login application->(Login) that starts when i run the program in Netbeans, When login credentials are verified i hide the stage and start another stage->(Stardust).
I have a label in Stardust that is initially empty but after login should show the username. I have seen countless questions regarding this and most of the answers didn't even work for the one who asked so forgive me if you find this duplicate.
I have created a method for taking the username from Login into Stardust but when i try : label.setText(user);
it gives a NullPointerException image
as you can see when i am printing i get the name but it is not setting as label's text. Also if possible i would like this task to happen when this method is called.
//Requested Code
'static void launcher() {
Platform.runLater(new Runnable() {
public void run() {
new Stardust().start(new Stage());
}
});
}'
I called it like Login.launcher();
when login is successful in LoginController.java
public static void main(String[] args) {
Application.launch(Login.class);
}
is how i launch the Login from Stardust