[英]resize stackpane in javafx with css
我正在使用javaFx,我想調整我的stackPane或添加邊框,我該怎么辦? 我怎么能把它放在中心或窗口?
這是我的代碼:
final HBox box = new HBox();
box.getStyleClass().add("box");
final ToolBar outils = new ToolBar();
final Button file = new Button("fichier");
final Button as2 = new Button("AS2");
final Button ftp = new Button("FTP");
final Button arrow = new Button("Liaison");
file.setGraphic(new ImageView("/images/file.png"));
as2.setGraphic(new ImageView("/images/http.png"));
ftp.setGraphic(new ImageView("/images/ftp.png"));
arrow.setGraphic(new ImageView("/images/Arrow.png"));
box.getChildren().addAll(file,as2,ftp,arrow);
outils.getItems().addAll(box);
// ma zone de dessin
final StackPane paint = new StackPane();
paint.setStyle("-fx-background-color: #FFFFFF;");
paint.setPrefSize(0, 690);
paint.getStyleClass().add("paint");
這是我的窗口:
TKS
嘗試這個 ; 在你的控制器中
@FXML StackPane窗格;
public void Action(){
.
.
.
pane.setPrefHeight(value);
pane.setPrefWidth(value);
.
.
.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.