Re: Color Changing, JTable
U can create a custom renderer. This renderer will maintain state 'DEFAULT', 'COLORED'.
Now the renderer be probably 'JLabel' only. The only thing is u will check the state and then decide whether to color the background. If no, just do 'setOpaque(false)'. If yes, check the row index and give the background color accordingly.
Now to change the state of renderer...
1. U will have a function to the renderer class say 'toggleState' This will toggle the state.
2. In the handler of change button, u will call this method. (For this u will need to store the object of the renderer class in the class having handler for the button, or u can retrieve the renderer and typecast it)
Does this answer ur question?
- UnicMan
http://members.tripod.com/unicman