document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import javafx.application.Application;
  2.  
  3. import javafx.concurrent.Service;
  4.  
  5. import javafx.concurrent.Task;
  6.  
  7.  
  8.  
  9.   Service <String> service=new Service() {
  10.  
  11.          @Override
  12.  
  13.          protected Task <String> createTask() {
  14.  
  15.              //retorno do taskstringk
  16.  
  17.              return new Task<String>(){
  18.  
  19.                 @Override
  20.  
  21.                 protected String call() throws Exception {
  22.  
  23.                     System.out.println("Metodo.call() string iniciado");
  24.  
  25.                     Thread.sleep(1000);//->thread// tarefa
  26.  
  27.                     System.out.println("metodo.call()string finalizando");
  28.  
  29.                     return null;// retorno nul
  30.  
  31. }  
  32.     };
  33.        }
  34.     };
  35.  
  36.        
  37.  
  38.            service.start();
  39.  
  40.      
');