Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mousePressed not triggered  RSS feed

 
Petr Kalis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have created small table editor, cells are extended JLabels. I am battling with strange problem. I am able to select and highlight cell(even with right mouse button - RMB ), open popup menu (hey, e.isPopupTrigger() on different OS kicked my ass ;) ), but when I move mouse to different cell, click with RMB, somehow it seems, that mousePressed event is not fired and it is consumed somewhere (with debugging I found that the flow is going to the mouseReleased() directly). And I can't find a solution
I found somewhere, that adding Tooltip could be problem..it wasn't for me.
It seems, that JPopupMenu.show() is consuming mousePressed event, could be this avoided somehow?
Thanks for ideas.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine for me with a regular old MouseListener. I'm using JDK6 on XP.

If you need further help then you need to create a SSCCE (Short, Self Contained, Compilable and Executable, Example Program), that demonstrates the incorrect behaviour.

Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
 
Petr Kalis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my bad. I accused wrong victim. show() is innocent, so show must go on!
Something else is consuming mousePressed event, sadly I am working on large application and still I wasn't able to find the problem. So I haxored it somehow.
Anyway, thanks for concern and ideas.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!