title: JavaFX label wrapped within HBox within ScrollPane not working
body: <p>I try to build chat using <code>ScrollPane</code> for scrolling and <code>VBox</code> for the view (<code>scroll.setContent(vbox);</code>). Each message create new <code>HBox</code> and <code>Label</code> in it.
  The label contain the text and declared <code>text.setWrapText(true);</code></p>
  
  <p>When there is enough space without scrolling its work fine:</p>
  
  <p><a href="https://i.stack.imgur.com/uoXN6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uoXN6.png" alt="Wrapping work"></a></p>
  
  <p>But when the messages height greater then the <code>VHox</code> height (view of the <code>ScrollPane</code>) the wrapping not working:</p>
  
  <p><a href="https://i.stack.imgur.com/zd1QJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zd1QJ.png" alt="Wrapping not working"></a></p>
  
  <p><strong>EDIT:</strong> relevant code:</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.control.Label;
  import javafx.scene.control.ScrollPane;
  import javafx.scene.layout.HBox;
  import javafx.scene.layout.VBox;
  import javafx.stage.Stage;
  
  public class ChatExample extends Application
  {
      public static void main(String[] args)
      {
          launch(args);
      }
  
      @Override
      public void start(Stage stage) throws Exception
      {
          ScrollPane scroll = new ScrollPane();
          scroll.setFitToHeight(true);
          scroll.setPrefSize(300, 300);
          VBox chat = new VBox();
          chat.setSpacing(10);
          scroll.setContent(chat);
  
          chat.getChildren().add(addMessage("This is a wrapped message, This is a wrapped message"));
          chat.getChildren().add(addMessage("This is a wrapped message, This is a wrapped message"));
          chat.getChildren().add(addMessage("This is a wrapped message, This is a wrapped message"));
          chat.getChildren().add(addMessage("This is a wrapped message, This is a wrapped message"));
  
          final Scene scene = new Scene(scroll, 300, 300);
  
          stage.setScene(scene);
          stage.show();
      }
  
      public HBox addMessage(String message)
      {
          HBox hbox = new HBox();
          Label label = new Label(message);
          label.setWrapText(true);
          label.setMaxWidth(50);
  
          hbox.getChildren().add(label);
          return hbox;
      }
  }
  </code></pre>