title: JavaFX : How to get column and row index in gridpane?
body: <p>I tried to get the row/column index of gridpane, when I click.</p>
  
  <p>I am looking for method like as <a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html#getSelectedColumn%28%29" rel="nofollow noreferrer">getSelectedColumn()</a> in JTable(java swing)</p>
  
  <p>I searched this. <a href="https://stackoverflow.com/questions/17083974/how-get-column-index-and-row-index-in-gridpane-of-javafx">gridPane.getRowIndex(node)</a></p>
  
  <p>But it doesn't help to me. Because it need <strong><em>node</em></strong> name to get row/column index.</p>
  
  <p>I make a component of grid by for grammar. So the node name is same.
  How can I get the value? My partial code is below.</p>
  
  <pre><code>for (int i = 0; i &lt; imageName.length; i++) {
     try {
        img = new Image(getClass().getResourceAsStream(imageName[i]));   
     } catch (Exception e) {
        System.out.println("exception : " + e);
     }
        ImageView imageview = new ImageView(img);
        imageview.setFitWidth(40);
        imageview.setFitHeight(40);
  
        HBox hbox= new HBox();
        hbox.getChildren().add(imageview);
        tile1.setHgap(40);
        tile1.setVgap(40);
        tile1.add(hbox, i+2, 0);
  }
  </code></pre>