I have a javafx application that I want to write and let's assume it has two rectangles on its scene and we are able to move these rectangles. My problem is that I want to write the program in a way that the image of the first rectangle always appears before the second one.
I mean that in the case that the two rectangles overlap, we always see the image of the second rectangle on the front. ( We see the second rectangle as a complete rectangle and the first one is a rectangle a part of which is not seen because of the overlap. ) and I always want the second rectangle on the front.