how get column index and row index in gridpane of javafx

后端 未结 1 1471
无人及你
无人及你 2020-12-03 15:56

how get column index and row index in GridPane of JavaFX. see the code below

Text text1 = new Text(\"Te         


        
相关标签:
1条回答
  • 2020-12-03 16:09

    You can get the row index and column index by utilising the static methods getRowIndex() and getColumnIndex() which are located in the GridPane class.

    System.out.println("Row: "+ GridPane.getRowIndex(text1));
    System.out.println("Column: "+ GridPane.getColumnIndex(text1));
    

    See for reference: http://docs.oracle.com/javafx/2/api/javafx/scene/layout/GridPane.html#getRowIndex(javafx.scene.Node)

    0 讨论(0)
提交回复
热议问题