Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8133701

[Linux] DialogPane broken after expanding content

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux jan-t430s 3.13.0-61-generic #100-Ubuntu SMP Wed Jul 29 11:21:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Kubuntu (KDE 4.13.3)

      Other Linux environments seem to be affected as well.

      A DESCRIPTION OF THE PROBLEM :
      Create an Alert and set the expandableContent (TextArea with long text).

      Initially the DialogPane is not expanded (correct). After clicking on the "Show details" the TextArea is show but layout is broken:
      http://i.imgur.com/xxSL2xM.png
      If then the user resizes the window the layout is correct:
      http://i.imgur.com/6oE65ig.png
      However after clicking on "Hide details" the layout is broken again
      http://i.imgur.com/GjuiDWm.png
      (Resizing the window manually fixes it again).


      See also:
      http://stackoverflow.com/questions/28958164/javafxjava-8-update-40-alert-dialog-cant-redraw-and-resize-successfully

      It seems to be working fine on a Mac.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Run the attached code sample on a Linux machine
      2) Click "Show details" and "Hide details" in the dialog

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Clicking the "Show details" and "Hide details" would show/hide the expandedContent (e.g. TextArea) in the dialog window correctly.
      ACTUAL -
      The expandedContent is shown/hidden but the layout is broken:
      http://i.imgur.com/GjuiDWm.png

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.example;

      import java.io.ByteArrayOutputStream;
      import java.io.PrintStream;

      import javafx.application.Application;
      import javafx.scene.control.Alert;
      import javafx.scene.control.TextArea;
      import javafx.stage.Stage;

      public class ExpandableDialogPaneBug extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage primaryStage) throws Exception {
              Alert alert = new Alert(Alert.AlertType.ERROR);
              ByteArrayOutputStream out = new ByteArrayOutputStream();
              new Exception().printStackTrace(new PrintStream(out));
              alert.getDialogPane().setExpandableContent(new TextArea(new String(out.toByteArray())));
              alert.show();
          }


      }

      ---------- END SOURCE ----------

            scfitch Stephen Fitch
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: