How to display GridPane object grid lines permanently, and without using the setGridLinesVisible() method?

前端 未结 4 1564
太阳男子
太阳男子 2021-01-18 02:31

Is it possible to make all GridPane\'s grid lines permanently visible without using setGridLinesVisible()?

I know that setGridLinesVisible()

4条回答
  •  旧巷少年郎
    2021-01-18 02:48

    For every children use:

    -fx-border-color: black;
    -fx-border-width: 0 0 1 1;
    

    This can be achieved with the yourChildNode.setStyle(css) method for example.

    Should one cell contain multiple layouts wrap them in one AnchorPane and apply the CSS on the AnchorPane.

提交回复
热议问题