title: JavaFX Alerts and their size
body: <p>Recently, JavaFX introduced Alerts (Java 8u40). </p>
  
  <p>Consider the code example below. How can I display a full message that is longer than just a few words? My messages (<code>contentText</code> property) get cut at the end with <code>...</code> and the Alert does not adjust its size properly in my opinion.</p>
  
  <p>On my Linux machine with Oracle JDK 8u40, I only see the text <code>This is a long text. Lorem ipsum dolor sit amet</code>, which is too short in some cases. </p>
  
  <p>Of course, the user can resize the Alert window manually and the text will be displayed accordingly, but that is not user-friendly at all. </p>
  
  <p>Edit: Screenshots for Windows 7 and Linux (JDK from Oracle): 
  <img src="https://i.stack.imgur.com/zM0aR.png" alt="Windows Alert">
  <img src="https://i.stack.imgur.com/Hf0JX.png" alt="Linux Alert"></p>
  
  <pre><code>import javafx.application.Application;
  import javafx.scene.control.Alert;
  import javafx.scene.control.Alert.AlertType;
  import javafx.stage.Stage;
  
  
  public class TestAlert extends Application {
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          Alert a = new Alert(AlertType.INFORMATION);
          a.setTitle("My Title");
          a.setHeaderText("My Header Text");
          a.setResizable(true);
          String version = System.getProperty("java.version");
          String content = String.format("Java: %s.\nThis is a long text. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.", version);
          a.setContentText(content);
          a.showAndWait();
      }
  }
  </code></pre>