title: close gui window after progress bar finishes loading
body: <p>I am new to java programming and I had a question with a problem I am having.</p>
  
  <p>The code I currently have in place (that works) is loading the progress bar...but I would like the loading window to close upon progress bar completion [similar effect to a standalone program]</p>
  
  <p>the name of my stage is called welcome
  the progressbar is called load</p>
  
  <p>here is my code:</p>
  
  <pre><code>final SimpleDoubleProperty prop = new SimpleDoubleProperty(0);
  
      load.progressProperty().bind(prop);
      load.prefWidthProperty().bind(start.widthProperty());
  
      new Thread(){
   @Override
   public void run(){                
        try {
  
             for(double i=0; i&lt;=1; i+=0.01){
                  prop.set(i); 
                  Thread.sleep(100);
  
             }                   
  
  
  
  
        } catch (InterruptedException ex) {
             System.err.println("Error on Thread Sleep");
  
      }
  
  
  
   }
  </code></pre>
  
  <p>}.start();</p>
  
  <p>I tried in many areas of the code block to include either welcome.hide() or welcome.close() after the for loop block and the try-catch block. </p>
  
  <p>any help would be appreciated </p>
  
  <p>Thanks! </p>