Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8106709

HBox/VBox do not trigger MouseEvents for all nodes present in it

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2 P2
    • fx1.2
    • fx1.2
    • javafx
    • Windows XP Prof, marina b05

      This is reproducible with marina b05, not reproducible with franca.

      Run the below program. It shows a blue rectangle and a red rectangle in an HBox. When the blue rectangle is clicked, HBox triggers mouse events. But, mouse events are not triggered on clicking the red rectangle

      import javafx.stage.*;
      import javafx.scene.*;
      import javafx.scene.input.*;
      import javafx.scene.shape.*;
      import javafx.scene.paint.*;
      import javafx.scene.layout.*;

      Stage {
          scene: Scene {
              content: HBox {
                  content: [Rectangle {
                      x: 0
                      y: 0
                      width: 50
                      height: 40
                      fill: Color.BLUE
                  }, Rectangle {
                      x: 0
                      y: 0
                      width: 50
                      height: 40
                      fill: Color.RED
                  }]
                  onMousePressed: function(e: MouseEvent) {
                      println("mouse pressed");
                  }
              }
          }
          width: 100
          height: 100
      }


            amfowler Anne Fowler (Inactive)
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: