• Post Reply Bookmark Topic Watch Topic
  • New Topic

Remove Mouse Listener from JavaFx Label  RSS feed

 
Akila Sachitra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am a beginner in javafx.

i want to remove mouse listener in JavaFx Label

In java swing we have method like this >> Jlabel.removeMouseListener( )


i want to do same thing in JavaFX Label
 
John Damien Smith
Ranch Hand
Posts: 352
21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you added your listener using setOnClicked(listener), you can remove it using setOnClicked(null).

If instead you used addEventHandler, then you can remove it using removeEventHandler.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!