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
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
- is blocked by
-
JDK-8128435 Edge case for Region.boundedSize policy
- Closed