File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes colour a cell based on value input using the CellRenderer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "colour a cell based on value input using the CellRenderer?" Watch "colour a cell based on value input using the CellRenderer?" New topic
Author

colour a cell based on value input using the CellRenderer?

Joezy Whzy
Greenhorn

Joined: Mar 25, 2013
Posts: 1
Hi, basically I am using JTables and I have a row of data. I have a user ID column, and a status column (along with a bunch of other), what I want is when the 'status' column is edited and "Accepted" is typed, the user ID should turn green. If "Rejected" is typed the user ID should turn red. This has to I guess happen dynamically, as once its opened and either accepted/rejected are typed then enter is pressed it should change.

I have tried a few methods and code from online but I just cannot do it. Can someone please guide me through the process!

THanks.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1083
    
  10

Hi,
Welcome to the Ranch!

Did you check the tutorial page ?
If you scroll down in that page, it has an example which I think fits your case.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
Consider Paul's rocket mass heater.
 
subject: colour a cell based on value input using the CellRenderer?