public void setBtnAction(ActionEvent event) {
String leagueNameString = nameFld.getText();
if ((leagueNameString == null) || (leagueNameString == "")) {
nameFld.setPromptText("Enter value league name");
} else {
CoreAppFXMLController cp = new CoreAppFXMLController();
cp.nameOfTheLeague.setText(leagueNameString);
}
}
}
I tried with both, text and label, but none of them works. nameOfTheLeague is protected in CoreAppFXMLController class. It returns me NullPointerException. id's are ok in fxml.