• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable and Mouse Events  RSS feed

 
Ste Graham
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTable which acts as an "overview" for all retreived records, and also in the same interface I have a series of JTextFields that act as a "form" for a chosen individual record. I want to be able to click on one of the rows in the JTable and have that record displayed in the JTextFields that make up the "record form". The first thing I am struggling with is how to tell which JTable record the user has clicked on. My GUI class is extending the MouseAdapter class, and I'm been experimenting overriding the mouseClicked and mousePressed methods, but I cannot see how to pinpoint the exact record. Once I have this information I can return to my TableModel, retrive the correct record and populate the text fields. Can anyone please point me in the right direction? Thanks!

Stephen :-)
 
Ste Graham
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I've found what I am looking for:

JTable - MouseEvent

I'll give this a go.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!