The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
import-bot (20211) [Avatar] Offline
#1
[Originally posted by jsbmk1]

Hi..

I hava implemented a jTable with customized data model in my application. I
want to change the color of the selected row when the user selects a row and I
want the color of that row to remain changed even when the user selects or
moves to another row. I have tried the setSelectionForeground() and
setSelectionBackground() but both of these change the foreground and
background of the selected row but goes back to default when the user moves to
another row. So, there is no way for the user to know which rows he/she has
visited before.
import-bot (20211) [Avatar] Offline
#2
Re: Jtable problem!!
[Originally posted by wwake]

Try using a TableCellRenderer:

See http://www.mindspring.com/~scdrye/java/faq.html#table_color

I think any of the Swing books would have an example.