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

Improper justification (Label)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u6
    • javafx

      I am presenting a dialog message to the user using a Label styled with
      -fx-text-alignment: justify;
      And with wrapping enabled.

      Although this works as expected, I have noticed that quite often the last two words of the first line of text in the message are spaced improperly. At first I thought this was a programming error, but no, it fails consistently. As an example, try displaying a label containing the text

      String message = "For at afslutte beskyttelsen af denne adresse, må du først " +
      "logge ind. Log venligst ind ved at vælge dit portræt og " +
      "indtaste din adgangskode.";

      in a window which you can make narrower using your mouse. Then you will be able to reproduce the error which is also shown in the attached screen shot. Notice how you can get the words "du" and "først" to be placed almost right next to each other.

      I am guessing this is caused my a faulty spacing algorithm.

            fheidric Felipe Heidrich (Inactive)
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: