Can one controller class have two or more initialize () ?
Can multiple statements be in a single initialize() ?
@question 2...This is my controller class:
@Overide
public void initialize(URL url,ResourceBundle rb)
{
//adding itemList variable to itemBox
try{
itemBox.setValue("Gari");
itemBox.setItems(itemList);
}
catch(Exception e){
System.out.println(e);
}
//Animation for changing scene
String filename = url.getFile().substring(URL.getFile().lastIndexOf('/')+1, URL.getFile().length());
if(filename.equals("FXML.fxml")){
//calling fadeTransition method
fadeTrans(anchorPane);
}
else if(filename.equals("SignUp_In.fxml")){
fadeTrans (anchorPaneSignUp_In);
}
}
and it returns this error message:
java.lang.NullPointerException
Here, the multiple statements are adding itemList to itemBox and changing scene with animation