当JavaFX javafx.scene.control.Labeled元素调整宽度以适合文本时

时间:2018-05-14 13:42:35

标签: javafx

在我设置按钮的文字后,它的宽度属性此时不会改变

@Override
public void start(Stage stage) throws Exception {

    Parent parent = ...
    ...
    Button component added to the parent
    ...
    Scene scene = new Scene(parent);
    stage.setScene(scene);
    stage.show();           
    ...
    Button's width is 30.0
    Button's text is set here
    Button's width still is 30.0
    ...
}

0 个答案:

没有答案