• Post Reply Bookmark Topic Watch Topic
  • New Topic

left and right clicking  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I working on an application were i need to identify if a user has single or double clicked with the left or right mouse button on a JLabel. But all the is detected is a left click (single or double).



What am I missingm the isPopupTrigger() function appears not to be working.

Cheers

Simon
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the note in the Method Detail section of the MouseEvent api for the isPopupTrigger method.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello sir,
Move ur code from mouseClicked to mouseReleased,
then it works fine
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!