Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mouse Events not working in a JTable  RSS feed

 
bart sides
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have a JTable inside of a JScrollPane and I'm trying to add any kind of mouse listener. For some reason I can't get any of them to work. If I add a motion listener to the scroll pane it will work when the mouse is not on the table. Here's what I tried:

I've tried most of the mouse listeners and I even saw something similar to my problem on a forum and they used the same code! Anyway if you guys have any ideas I'd appreciate them.

Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works OK for me.

post a simple working program that shows the problem
just a frame with empty JTable in a JScrollpane, with listener
 
bart sides
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhh I created a new table after adding the listener and didn't bother to add another. Thanks for the help, sorry for taking your time. For users trying to create a table with a listener, this code works.

Thanks again,
Bart

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!