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
Post a Comment