小编Sag*_*gir的帖子

BorderPane overlaping content

I have child GridPane, I want if text will increase then text should not goes to out of gridPane, instead ScrollPane, I don't want see go Apple text out side of box.

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

    String border = "-fx-border-color:red;";

    Text title=new Text("Machin");

    GridPane topLeft=new GridPane();
    topLeft.setMinSize(80, 5);
    topLeft.setMaxSize(80, 80);

    topLeft.setStyle(border);

    topLeft.add(title, 0, 0);

    for(int i=1;i<=15;i++) {
        topLeft.add(new Text("Apple"), 0,i);
    }


    GridPane root = new GridPane();
    root.setAlignment(Pos.CENTER);

    root.setHgap(20);
    root.setVgap(20);

    root.add(topLeft, 0, 0);



    BorderPane borderPane = new …
Run Code Online (Sandbox Code Playgroud)

java javafx

1
推荐指数
1
解决办法
51
查看次数

标签 统计

java ×1

javafx ×1