My problem is that I don't know how to color cells inside JTable.
Read the API for JTable and follow the link to the tutorial on How to Use Tables, where you will find a section on renderers and editors. Go through that section carefully.
Note: I am using java 1.4
May I ask why you are using a version that reached its end-of-life on 30 October 2008?