4 Replies Latest reply: Nov 8, 2012 6:13 AM by fabsav RSS

    events on layers

    fabsav
      Hi!
      i've some "layers" (a stackPane with 2 anchor panes). the anchor pane in front contains only few objects, so i can view the other anchor pane.

      How can I perform a click on the second layer?

      thank you :)
        • 1. Re: events on layers
          shakir.gusaroff
          Hi. There is a setMouseTransparent(boolean) on Node . Mouse events on node with mouseTransparent set to true will be ignored and
          captured by the topmost node below.
          • 2. Re: events on layers
            jsmith
            Also take a look at the node's pickOnBounds property if you did want to allow picking of the visible nodes in the topmost pane, but still allow picking of the nodes in the bottom pane when you click "between" the nodes in the topmost pane.

            http://docs.oracle.com/javafx/2/api/javafx/scene/Node.html#pickOnBoundsProperty

            From your description it would seem that you don't really need pickOnBounds and Shakir's suggestion of setMouseTransparent is what you want for your case.
            • 3. Re: events on layers
              fabsav
              i need to click on both layers... i think i solved using a group as top layer, instead of a pane.
              it allows to click nodes and ignore events in the "empty space" :)

              thank you both !
              • 4. Re: events on layers
                fabsav
                in effect your answer is the right one to my question as it is.