0
当货币标签(进入moneyBox)不超过5位时,一切都很好,但是当钱增加时,设计就会变得混乱。我该如何解决它?HBox的元素工作不正确
StackPane bottom = new StackPane();
VBox vboxBottom = new VBox();
HBox hboxBottomElements = new HBox(15);
HBox hboxBottomMain = new HBox(0);
hboxBottomElements.getChildren().addAll(visaLabel, separator2, adLabel, separator3, governRelationStatus, separator4, christianityLabel);
hboxBottomElements.setPadding(new Insets(5));
vboxBottom.getChildren().addAll(season, separator1, hboxBottomElements);
vboxBottom.setPadding(new Insets(30,0,0,0));
bottom.getChildren().addAll(vboxBottom, next);
StackPane.setAlignment(next, Pos.BOTTOM_RIGHT);
StackPane.setMargin(next, new Insets(0,0,0,999));
hboxBottomMain.getChildren().addAll(moneyBox, bottom);
layout.setBottom(hboxBottomMain);
时,它得到的是大
对'wrapText'属性使用'false'应该会导致省略号而不是换行符。我不知道,如果这是所需的行为,因为你没有描述所需的行为......另外请注意,很难从代码中获得场景结构,特别是如果一半的节点在代码之外的某处被创建/声明片段。考虑创建一个fxml文件,创建必要的节点结构来重现问题... – fabian
这里是解决方案: http://stackoverflow.com/questions/42599738/java-fx-out-of-the-window-screen? noredirect = 1#comment72330340_42599738 –