【问题标题】:Set BorderPane components size设置 BorderPane 组件大小
【发布时间】:2013-08-26 10:23:16
【问题描述】:

我想设置 BorderPane 的 Center、Top、Left、Right 和 Bottom 组件的大小。

到目前为止,我发现了这个:

BorderPane() mainpane = new BorderPane();
mainPane.getBottom().prefWidth(sizeX);

例如,如何获取 BorderPane 左侧的大小并设置大小?

【问题讨论】:

    标签: javafx-2 javafx javafx-8


    【解决方案1】:

    BorderPane 的“左侧”是你设置的任何值,它的大小是你设置的任何值。

    示例:

    BorderPane mainpane = new BorderPane();
    StackPane left = new StackPane();
    left.setPrefWidth(100);
    mainPane.setLeft(left);
    

    【讨论】:

      猜你喜欢
      • 2014-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-16
      相关资源
      最近更新 更多