While it's obvious how to set the width/height of a column/row in a GridPane
, how can I actually query these values?
JavaFX8: There is a pack protected method GridPane.getGrid
to get the current row/col sizes in a two dim double array.You could use reflection to acccess it. In environments with a security mgr, this won't work.
public double[][] getCurrentGrid(GridPane gp) {
double[][] ret=new double [0][0];
try {
Method m=gp.getClass().getDeclaredMethod("getGrid");
m.setAccessible(true);
ret=(double[][])m.invoke(gp);
} catch (Exception e) {
e.printStackTrace();
}
return ret;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With