本文整理了Java中javafx.scene.layout.VBox.getPrefWidth()
方法的一些代码示例,展示了VBox.getPrefWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.getPrefWidth()
方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:getPrefWidth
暂无
代码示例来源:origin: stackoverflow.com
VBox vBox = new VBox();
vBox.setPrefWidth(100);
Button btn1 = new Button("Short");
Button btn2 = new Button("Super Long Button");
btn1.setMinWidth(vBox.getPrefWidth());
btn2.setMinWidth(vBox.getPrefWidth());
vBox.getChildren().addAll(btn1, btn2);
代码示例来源:origin: org.copper-engine/copper-monitoring-client
private void initPreview() {
FXMLLoader loader = new FXMLLoader(getClass().getResource("Preview.fxml"));
try {
VBox preview = (VBox)loader.load();
double width = preview.getPrefWidth();
double height = preview.getPrefHeight();
previewPane.getChildren().add(preview);
previewPane.setScaleX(SCALE);
previewPane.setScaleY(SCALE);
double translateX = -width * (1 - SCALE) / 2;
double translateY = -height * (1 - SCALE) / 2;
previewPane.setTranslateX(translateX);
previewPane.setTranslateY(translateY);
} catch (IOException e) {
e.printStackTrace();
}
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
@Override
public void run() {
Window dialog = previewPane.getScene().getWindow();
double currWidth = dialog.getWidth();
double currHeight = dialog.getHeight();
dialog.setWidth(Math.max(currWidth, 20 + previewPane.getLayoutX() + previewPane.getPrefWidth()));
dialog.setHeight(20 + currHeight + previewPane.getPrefHeight());
updatePreview();
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
try {
VBox preview = (VBox)loader.load();
double width = preview.getPrefWidth();
double height = preview.getPrefHeight();
内容来源于网络,如有侵权,请联系作者删除!