问题描述:

hey i have a gridpane and for one of the nodes i want it to be able to take up the whole row.

but i cant seem to figure out how to use GridPane.setColumnSpan(node, column span);

heres my code

grid.getChildren().addAll(animalFields(animal));

grid.setHgap(10);

grid.addRow(2, status, neutered, chipped, vaccinated, reserved);

grid.addRow(3, statusCb,new HBox(neuteredYes, neuteredNo), new HBox(chippedYes, chippedNo), new HBox(vaccinatedYes, vaccinatedNo), new HBox(reservedYes, reservedNo));

grid.addRow(4, new Label("people interested"));

grid.addRow(6, sponsorsTable(((Adoption) animal.getAdoption()).getInterested()));

GridPane.setColumnSpan(sponsorsTable(((Adoption) animal.getAdoption()).getInterested()), 6);

grid.addRow(7, hBox2);

this is how it looks now

this is what i want it to look like

id be grateful for any help. thanks

网友答案:

You can use GridPane.REMAINING:

GridPane.setColumnSpan(yourNode, GridPane.REMAINING);
相关阅读:
Top