How do I add two images, one above the other to a shape in JavaFX?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How do I add two images, one above the other to a shape in JavaFX?



Please help.



I am trying to add two images to the shape:


@FXML
private Rectangle rectangle;
Image img1 = new Image("a.png");
Image img2 = new Image("b.png");
rectangle.setFill(new ImagePattern(img1));
rectangle.setFill(new ImagePattern(img2));



These images have a transparent background. Both should be visible. One above the other.



But only one is visible.



I will be grateful for the advice.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

Future solutions