java - Interaction with a cell renderer in JTable -


is there way cell renderer respond mouse events, such mouseovers?

never tried guess need to:

a) create custom renderer paint cell in 2 states

b) need keep track of cell should painted in "mouse over" state

c) add mouse listener track mouse entered/exited , mousemoved. each event need update variable tracks cell mouse positioned over. can use columnatpoint() , rowatpoint() methods of jtable

d) when mouse leaves cell need invoke repaint() on cell. can use getcellrect() method determine cell repaint

e) when mouse enters cell need reset cell value "mouse over" state , repaint cell.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -