• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doble clicking a cell in JTable

 
Elizabeth Luckose
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can I catch double clicking a cell in a table. I am using default table model. I want to get the value in the cell on double clicking it.
If possible, please tell me how it can be done?
Thanks
Elizabeth
 
Johannes Hartman
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elizabeth
When adding a mouselistener to your table (have you done this??) you could test for a double click in the mouseClicked method by testing the event for click counts -- if (evt.getClickCount() == 2) -- where evt is the MouseEvent object. From here you could use table methods to extract the objects/information etc. from the table...
cheers!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!