javaFX have ProgressMonitorDialog like jface? ProgressIndicator don't help.
javaFX have ProgressMonitorDialog like jface? ProgressIndicator don't help.
I need a loading page like ProgressMonitorDialog in jface.
Then when i do some time-consuming operation, a loading page will be loaded until the operation is over.
The problem is that when i use a Service class, i must put the time-consuming operation outside the Platform.runLater(new Runnable().
and i must put the javaFX controls set operation in the Platform.runLater(new Runnable(), it's very difficult to seperate them sometimes.
ProgressIndicator doesn't help in this case.
Thank you.
button.setOnMouseClicked(new EventHandler<MouseEvent>() {
public void handle(MouseEvent me) {
stage.show();
final Task<Integer> task = new Task<Integer>()
{
@Override
protected Integer call()
throws Exception
{
// TODO Auto-generated method stub
System.out.println("ssss");
try
{
Thread.sleep(5000);
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Platform.runLater(new Runnable()
{
@Override
public void run()
{
// when do something time-consuming here, then stage.Show(); above can't be loaded immediately when button clicked //,why? The thread will always wait the time-consuming operation.
button2.setText("dddddddd");
stage.close();
}
});
// TODO Auto-generated method stub
return null;
}
};
Service<Integer> service = new Service<Integer>()
{
@Override
protected Task<Integer> createTask()
{
// TODO Auto-generated method stub
return task;
}
};
service.start();
}});