Tricky JTable question

H

H.L

Assume that I have an individual cell inside a JTable with a multi-line
string. When a mouse double click or click is recorded, I would like to
know not only what cell was clicked (fairly easy with the rowatPoint and
columnatpoint routines), but also which of the rows inside the cell was
clicked. How can I do that? It does seem rather tricky and it is hard to
see how it should be set up. Thanks in advance.

Regards.
 
R

Roedy Green

Assume that I have an individual cell inside a JTable with a multi-line
string. When a mouse double click or click is recorded, I would like to
know not only what cell was clicked (fairly easy with the rowatPoint and
columnatpoint routines), but also which of the rows inside the cell was
clicked. How can I do that? It does seem rather tricky and it is hard to
see how it should be set up. Thanks in advance.

Does the event give you x,y? What are they relative too? If you know
the line height, divide.
 
H

H.L

H.L said:
Assume that I have an individual cell inside a JTable with a multi-line
string. When a mouse double click or click is recorded, I would like to
know not only what cell was clicked (fairly easy with the rowatPoint and
columnatpoint routines), but also which of the rows inside the cell was
clicked. How can I do that? It does seem rather tricky and it is hard to
see how it should be set up. Thanks in advance.

Regards.

Thanks to mr. Roedy Green for the tip that you gave!! I searched a bit
and found that JList is probably a better option for what I want to do.
I lost his post in the list of threads.

Regards.
 

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

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top