I have a Stage
Principal that is my Login:
In%ofthisstageIhaveaFXML
andaRegion
withtheProgressIndicator
property
AftersuccessfullyloggingintotheapplicationtheintentionwouldbetodisplaythissetVisible(false)
andRegion
whileathreadstartedtheapplication,butwhathappensisthatafterloggingin/em>startsrunningbyloadingtheapplication,butProgressIndicator
andRegion
arenotvisible.
Mythread
Taskt=newTask(){@OverrideprotectedObjectcall()throwsException{Platform.runLater(()->{try{newSisgeFX().start();}catch(IOExceptionex){Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE,null,ex);}});returnnull;}};region.visibleProperty().bind(t.runningProperty());pi.visibleProperty().bind(t.runningProperty());Threadth=newThread(t);th.start();
Itrieddoingtwothreads:onetoloadthesystemandanothertoupdateProgressIndicator
whilethesystemisnotloaded,buttonoavail,doesnotgenerateProgressIndicator
,I'vetrieditinseveralways.
WhatInoticedinmymanyattempts:
Threaddoesnotstart.
Excerptfromlogin:
@FXMLprivatevoidsysLogin(){Stringuser=ctfUserLogin.getText();Stringpass=ctfPassLogin.getText();LoginDAOloginDAO=DAOFactory.make(LoginDAO.class);Loginlogin=loginDAO.getLogin(user,pass);if(login!=null){runThread();//aquichamoaThreadpostadoacima.ctfPassLogin.setStyle(null);ctfUserLogin.setStyle(null);}else{ctfPassLogin.clear();ctfUserLogin.clear();ctfPassLogin.setStyle("-fx-border-color:red;");
ctfUserLogin.setStyle("-fx-border-color:red;");
//new ShakeTransition(vBox).play();
new WobbleTransition(vBox).play();
//new TadaTransition(vBox).play();
}
}
After successfully logging in to Exception
while the system loads in the background?