Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to style GridPane each grid's border

934225May 5 2012 — edited May 7 2012
I wants to style gridPane like a table that each cell have border. But when I add below code, it just outer most rectangle have border, but inner cell didn't have border.

GridPane grid = new GridPane();
grid.add(new Button(), 0, 0);
grid.add(new Button(), 1, 0);
grid.add(new Button(), 0, 1, 2, 1);
grid.setStyle("-fx-border: 2px solid; -fx-border-color: red;");


How can I set the cell border of the GridPane?

Edited by: Owen on May 5, 2012 7:32 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2012
Added on May 5 2012
2 comments
43,276 views