Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make it so the contents of the second row's contents and the contents of the rows after it are closer to the left. I can't figure out how to do this. Here's what I have so far.

What I have tried:

```
GridPane grid = new GridPane();
        Scene scene = new Scene(grid);
        stage.setTitle("Baseball Team");
        stage.setScene(scene);
        
        grid.setAlignment(Pos.TOP_LEFT);
        grid.setPadding(new Insets(10, 25, 25, 25));
        ColumnConstraints col1 = new ColumnConstraints();
        ColumnConstraints col2 = new ColumnConstraints();
        grid.getColumnConstraints().add(col1);
        grid.getColumnConstraints().add(col2);
        col1.setPrefWidth(70);
        col2.setPrefWidth(100);
        grid.setHgap(10);
        grid.setVgap(5);
        
        Label tNL = new Label("Tema Name:");
        grid.add(tNL, 0, 0);
        GridPane.setHalignment(tNL, HPos.RIGHT);
        teamName = new TextField();
        grid.add(teamName, 1, 0);
        
        Label p1L = new Label("1:");
        grid.add(p1L, 0, 1);
        GridPane.setHalignment(p1L, HPos.RIGHT);
        player1 = new TextField();
        grid.add(player1, 1, 1, 1, 1);
```
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900