JTable row selection (left and right mouse)

D

Derek

Is it possible to be able to allow users to use either the left or the right
mouse button to select one or more
rows in a JTable, and upon the selection, be able to tell which mouse button
they used to select the row(s)?

I have 15 tables on the screen. The user needs to select one or more rows
from one table (the source)
and then the same number of rows in another table (the destination) and then
I need to swap the row
data from both tables. So, I need a way to differentiate between the
selections on the source and the
destination tables.

Thank you.
 
Z

zero

Is it possible to be able to allow users to use either the left or the
right mouse button to select one or more
rows in a JTable, and upon the selection, be able to tell which mouse
button they used to select the row(s)?

I have 15 tables on the screen. The user needs to select one or more
rows from one table (the source)
and then the same number of rows in another table (the destination)
and then I need to swap the row
data from both tables. So, I need a way to differentiate between the
selections on the source and the
destination tables.

If you are swapping the rows, why would you need to know which is the
source and which the destination?

Just have the user select the two ranges, and then press a swap button.
Save the data of one of the tables (doesn't matter which) in a temp
variable, insert the data of the other table, and then insert the temp data
in the second table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top