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

A Labeled graphic node bounds can extend outside the bounds of the labeled control

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 9
    • fx2.0
    • javafx

      In some cases (I don't know all possible cases) setting max or preferable sizes of control don't make any effect:

      Text tx = new Text();
      tx.setText("fgggggggggggggggggggggggggggggggggggggggggggggggggg");
      Label label = new Label("ee", tx);
      label.setMaxWidth(40);
      label.setPrefWidth(40);

      HBox hb = new HBox();
      hb.setMaxWidth(50);
      hb.setPrefWidth(50);
      hb.getChildren().add(label);

      root.getChildren().add(hb);
      ...

      text "fgg...." will be as wide as it need. Text "ee" will not be printed at all. That doesn't seem a proper behavior

            msladecek Martin Sládeček
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: