Flippy Flippy - 10 months ago 70
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).