title: Text area for progress bar
body: <p>I would like to add a text area where the user can see some information that i can see in the console while the progress bar is updating.</p>
  
  <p>How can i add the text area ?</p>
  
  <p>Here is a sample of the code I have used to make the progress bar. Can i add below the progress bar the text area which should fill while computations are mare?</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.concurrent.Task;
  import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.geometry.Pos;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.control.ProgressBar;
  import javafx.scene.control.ProgressIndicator;
  import javafx.scene.layout.HBox;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Modality;
  import javafx.stage.Stage;
  import javafx.stage.StageStyle;
  
  public class ProgressDialogExample extends Application {
  static int option = 0;
  static ProgressForm pForm = new ProgressForm();
  
  @Override
  public void start(Stage primaryStage) {
      Button startButton = new Button("Start");
      startButton.setOnAction(e -&gt; {
  
          // In real life this task would do something useful and return
          // some meaningful result:
              Task&lt;Void&gt; task = new Task&lt;Void&gt;() {
                  @Override
                  public Void call() throws InterruptedException {
                      for (int i = 0; i &lt; 10; i++) {
                          updateProgress(i, 10);
                          Thread.sleep(200);
                      }
                      updateProgress(10, 10);
                      return null;
                  }
              };
  
              // binds progress of progress bars to progress of task:
              pForm.activateProgressBar(task);
  
              // in real life this method would get the result of the task
              // and update the UI based on its value:
              task.setOnSucceeded(event -&gt; {
                  startButton.setDisable(false);
              });
  
              startButton.setDisable(true);
              pForm.getDialogStage().show();
  
              Thread thread = new Thread(task);
              thread.start();
          });
  
      StackPane root = new StackPane(startButton);
      Scene scene = new Scene(root, 350, 75);
      primaryStage.setScene(scene);
      primaryStage.show();
  
  }
  
  private int closeWindow() {
      return option;
  }
  
  private static void setCloseWindow() {
      // TODO Auto-generated method stub
      option = 1;
  }
  
  public static class ProgressForm {
      private final Stage dialogStage;
      private final ProgressBar pb = new ProgressBar();
      private final ProgressIndicator pin = new ProgressIndicator();
  
      public ProgressForm() {
          dialogStage = new Stage();
          dialogStage.initStyle(StageStyle.UTILITY);
          // dialogStage.setResizable(false);
          // dialogStage.setWidth(400);
          // dialogStage.setHeight(300);
          // final VBox vbox = new VBox();
          dialogStage.initModality(Modality.APPLICATION_MODAL);
  
          final Button exitButton = new Button("Exit");
          exitButton.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
              @Override
              public void handle(ActionEvent e) {
                  pForm.getDialogStage().close();
                  setCloseWindow();
              }
          });
          // PROGRESS BAR
  
          pb.setProgress(-1F);
          pin.setProgress(-1F);
  
          final HBox hb = new HBox();
          hb.setSpacing(5);
          hb.setAlignment(Pos.CENTER);
          hb.getChildren().addAll(pb, pin,  exitButton);
  
          Scene scene = new Scene(hb);
  
          dialogStage.setScene(scene);
      }
  
      public void activateProgressBar(final Task&lt;?&gt; task) {
          pb.progressProperty().bind(task.progressProperty());
          pin.progressProperty().bind(task.progressProperty());
          dialogStage.show();
      }
  
      public Stage getDialogStage() {
          return dialogStage;
      }
  }
  
  public static void main(String[] args) {
      launch(args);
  }
  }
  </code></pre>