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

[Label] Ellipsis is not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8
    • javafx
    • jdk 1.8.0-ea-b57

    Description

      When prefWidth of the label decreases it clips the text, though it must use ellipsis.

      To reproduce shrink window width and there will be no ellipsis.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.OverrunStyle;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class Label_ellipsis extends Application {

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

          @Override
          public void start(Stage stage) throws Exception
          {
              Label label = new Label("The quick brown fox jumps over the lazy dog 01234567890");
              label.setEllipsisString("...");
              label.setTextOverrun(OverrunStyle.ELLIPSIS);

              VBox root = new VBox(10d);
              root.getChildren().add(label);
              
              Scene scene = new Scene(root);
              stage.setScene(scene);
              stage.show();
          }

      }

      Attachments

        Issue Links

          Activity

            People

              leifs Leif Samuelsson (Inactive)
              dzinkevi Dmitry Zinkevich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: