porting app from fxml to pure java code