i have small homework with stackpane and gridpane. i build gridpane and small rectangles but when i try to add to text to that rectangles it does not work. thank you for any help.
Text text = new Text(rand1);
text.setFill(Color.BLACK);
text.setFont(Font.font("Calibri",FontWeight.BOLD,FontPosture.REGULAR,12));
text.setX(30);
text.setY(30);
Rectangle rec = new Rectangle(x,y,30,30);
rec.setFill(color);
stackPane.getChildren().addAll(rec,text);
