1

Some weird things happened with JavaFX-application, working good on non-touchscreen Ubuntu 13.04. OnMouseClickedListener and any others, like onAction or onTouch don't catch Events , but CSS-styled buttons changes to selected while we touch it.. so the application knows, that button was touched. Also weird things happens with onAction listener: touch events are catches by applications, which placed "under" my app.

Code of adding touch listener:

btn1.setOnTouchPressed(new EventHandler<TouchEvent>() {
        @Override
        public void handle(TouchEvent touchEvent) {
            // deal with touch
            touchEvent.consume();
        }
    });

Code of adding touch listener and on action listener:

<Button fx:id="btn2" onMouseClicked="#clicksHandler" text="btn"/>
<Button fx:id="btn3" onAction="#actionHandler" text="btn"/>

And handlers of this events:

@FXML
private  void actionHandler(Event event){
    // Handle event
    event.consume();
}

@FXML
private  void clicksHandler(MouseEvent event){
    // Handle event
    event.consume();
}

Please, help to solve this problem.


Was founded workaround: installing ubuntu 12.04 LTS. Events are handled by OnMouseClickedListener.

Vadym Tretyak
  • 43
  • 1
  • 5
  • What are "weird things"? If you are touching the screen, your not clicking a mouse and you would not expect a mouse click listener to be triggered. Can you edit the question to supply [code](http://sscce.org/) and explain your issues more clearly? – jewelsea Oct 31 '13 at 21:41
  • As was written, events are not handled by any listener (onAction, onTouchPressed, onMouseClicked), for me it looks weird, that any listeners I found doesn't work. – Vadym Tretyak Nov 01 '13 at 12:05

0 Answers0