JavaFx GridPane - how to center elements

前端 未结 3 868
抹茶落季
抹茶落季 2021-01-04 10:25

I have a GridPane filled with 1-letter-labels.

Here is an image:

Here is the code:

int charSpacing = 1;
int charsInWid         


        
3条回答
  •  天命终不由人
    2021-01-04 11:23

    oh, that was easy. i did the alignment on the wrong place. adding this will do the job:

    tmp[currArrPos].setAlignment(Pos.CENTER);
    

    thanks anyway.

提交回复
热议问题