Flippy Flippy - 1 year ago 100
Java Question

JavaFX StackPane get Item in Front

as the title says, I'm using a StackPane where I stack my AnchorPanes(

). I want to know which AnchorPane is on top/in front. Is it possible to get the AnchorPane which is in Front?

Answer Source

The front one will be the last item in the parent's child list, i.e. call


on the parent (the StackPane, if I understand your question correctly).