how to use renderrend in the tutorial?

i wish to shade the area or textfield or table when i point my arrow to that particular place..

someme guide me to http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

n use the renderer..

how i implement to my code?

thanks for drop the time read and help me

[306 byte] By [ahgana] at [2007-10-2 3:58:59]
# 1
i wish to where where i just point to the table cell(just pointing..not click)..the particular table cell will be shade
ahgana at 2007-7-15 23:20:43 > top of Java-index,Desktop,Core GUI APIs...
# 2
Add a MouseListener to your JTable and on appropriate mouse events note the cursor position and repaint; use the methods in JTable to determine the cell under the cursor, and thus which cell should be highlighted.
itchyscratchya at 2007-7-15 23:20:43 > top of Java-index,Desktop,Core GUI APIs...
# 3
dear itchyscratchy,can describe more detailly cause i till a new in java..if allowable can show me some code or examples? please..
ahgana at 2007-7-15 23:20:43 > top of Java-index,Desktop,Core GUI APIs...
# 4

Look up the classes I mentioned in the Javadoc, that should tell you all you need to know.

Detect the mouse location with,

MouseListener.mouseMoved()

Get the cell position with,

JTable.columnAtPoint(), JTable.rowAtPoint()

And in your TableCellRenderer, if the cell in question is the one which is hovered over, set the background with,

JComponent.setBackground()

This article tells you enough to get you sorted with implementing your own renderer,

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

itchyscratchya at 2007-7-15 23:20:43 > top of Java-index,Desktop,Core GUI APIs...