本文整理了Java中javafx.scene.layout.VBox.setPrefSize()
方法的一些代码示例,展示了VBox.setPrefSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.setPrefSize()
方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:setPrefSize
暂无
代码示例来源:origin: stackoverflow.com
layout.setPrefSize(200, 100);
代码示例来源:origin: stackoverflow.com
VBox vbox = new VBox();
vbox.setPrefSize(400, 500);// prefWidth, prefHeight
代码示例来源:origin: stackoverflow.com
BorderPane root = new BorderPane();
Pane paneCenter= new Pane();
Canvas background= new Canvas(1200,1000);
Canvas animation = new Canvas(1200,1000);
Canvas animation2 = new Canvas(1200,1000);
paneCenter.getChildren().addAll(background, animation, animation2);
root.setCenter(paneCenter);
VBox paneRight = new VBox();
paneRight.setPrefSize(200, 1000);
paneRight.setPadding(new Insets(20));
paneRight.setAlignment(Pos.TOP_CENTER);
Button b1 = new Button("Spawn Civilian");
paneRight.getChildren().add(b1);
root.setRight(paneRight);
Scene scene = new Scene(root, 1400, 1000);
代码示例来源:origin: stackoverflow.com
layout.setPrefSize(100, 150);
代码示例来源:origin: stackoverflow.com
hb.setPrefSize(150, 150);
代码示例来源:origin: stackoverflow.com
public class JFXScroll extends Application {
@Override
public void start(Stage stage) throws Exception {
BorderPane main = new BorderPane();
ScrollPane scroll = new ScrollPane();
VBox box = new VBox();
// Demo purposes; Wouldn't normally do this - just let the box automatically fit the content
box.setPrefSize(1000, 500);
box.setEffect(new ColorInput(0,0,1000,500,Color.LIME));
scroll.setContent(box);
main.setLeft(new Label("Left Content"));
main.setCenter(scroll);
Scene scene = new Scene(main, 300, 250);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
代码示例来源:origin: stackoverflow.com
private VBox Chat(){
VBox chat = new VBox();
chat.setPrefSize(400, 400);
chat.setStyle("-fx-background-color:#333333;");
Label txt1 = new Label("Text1");
txt1.setTextFill(Color.WHITE);
txt1.setPrefWidth(400);
txt1.setAlignment(Pos.CENTER_LEFT);
Label txt2 = new Label("Text2");
txt2.setTextFill(Color.WHITE);
txt2.setPrefWidth(400);
txt2.setAlignment(Pos.CENTER_RIGHT);
chat.getChildren().addAll(txt1,txt2);
return chat;
}
代码示例来源:origin: stackoverflow.com
vbox.setPrefSize(300, 100);
progressAlert.getDialogPane().setContent(vbox);
progressAlert.initModality(Modality.WINDOW_MODAL);
代码示例来源:origin: org.copper-engine/copper-monitoring-client
previewPane.setPrefSize(scaledWidth, scaledHeight);
代码示例来源:origin: stackoverflow.com
@Override
public void start(Stage primaryStage) {
Button btn = new Button("Sort");
StackPane.setAlignment(btn, Pos.BOTTOM_CENTER);
TagBar tagBar = new TagBar();
btn.setOnAction((ActionEvent event) -> {
FXCollections.sort(tagBar.getTags());
});
Button btn2 = new Button("add \"42\"");
btn2.setOnAction(evt -> {
if (!tagBar.getTags().contains("42")) {
tagBar.getTags().add("42");
}
});
VBox root = new VBox();
root.getChildren().addAll(tagBar, btn, btn2);
root.setPrefSize(300, 400);
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
}
代码示例来源:origin: stackoverflow.com
public void handle(ActionEvent arg0) {
par.setPrefSize(Double.parseDouble(tf1.getText()), Double.parseDouble(tf2.getText()));
代码示例来源:origin: org.controlsfx/controlsfx
vbox.setPrefSize(300, 100);
代码示例来源:origin: stackoverflow.com
VBox pane = new VBox();
pane.setPrefSize(500, 500);
代码示例来源:origin: stackoverflow.com
buttons1.setPrefSize(stage.getWidth(),stage.getHeight());
Button nextSceneBtn=new Button("NEXT");
buttons1.getChildren().add(nextSceneBtn);
代码示例来源:origin: stackoverflow.com
view.setPrefSize(600, 400);
代码示例来源:origin: stackoverflow.com
layout.setPrefSize(250, 250);
layout.getChildren().setAll(stack, scaler);
VBox.setVgrow(stack, Priority.ALWAYS);
代码示例来源:origin: org.jrebirth.af.showcase/fonticon
private Node buildTile(final IconFont iconFont) {
final VBox box = new VBox();
box.setAlignment(Pos.CENTER);
box.setPrefSize(100, 50);
final Label icon = new Label();
iconFont.use(icon);
icon.setPadding(new Insets(4));
icon.setAlignment(Pos.CENTER);
VBox.setVgrow(icon, Priority.ALWAYS);
final Label text = new Label(iconFont.name());
text.setAlignment(Pos.BOTTOM_CENTER);
VBox.setVgrow(text, Priority.SOMETIMES);
text.setTooltip(new Tooltip(iconFont.name()));
box.getChildren().addAll(icon, text);
// box.setStyle("-fx-background-color:red;");
return box;
}
代码示例来源:origin: com.aquafx-project/aquafx
spacer.setPrefSize(1, 50);
content.getChildren().add(spacer);
代码示例来源:origin: PhoenicisOrg/phoenicis
});
dragTarget.setPrefSize(660, 308);
dragTarget.getStyleClass().addAll("dragAndDropBox");
内容来源于网络,如有侵权,请联系作者删除!