Click to See Complete Forum and Search --> : how does one select a JTable row on a right mouse click ?


August 23rd, 1999, 08:43 PM
Hi all,

I would like to know how to select a JTable row on a right mouse click?

thanks,
anonymous.

unicman
August 24th, 1999, 12:00 AM
what u can do is...

1) addMouseListener
2) when u get mouseClicked event, get the row index from the point using 'rowAtPoint'
3) and select it using 'addRowSelectionInterval'

Hope it solves ur problem.

- UnicMan

August 24th, 1999, 12:32 PM
thanks unicman,

i just needed to know the name of the api-call as they have changed it now. what a strange name. although i read all the api's more than ten times i did not think that this would be the one which would solve my problem. Thanks anyway. BTW do you have a mail id, where i can to you faster.

shantanu