wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes I want to color text inside multiple JTextFields located inside JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "I want to color text inside multiple JTextFields located inside JTable" Watch "I want to color text inside multiple JTextFields located inside JTable" New topic
Author

I want to color text inside multiple JTextFields located inside JTable

Taleb Elm
Greenhorn

Joined: Jun 13, 2013
Posts: 6
Hi, I have a JTable and all the Cells inside this table have JTextFiled. In addition, I have a method which have some logic and the output of this method will decide to color some cells inside this table. My problem is that I don't know how to color cells inside JTable. A sample of what I want to implement is mentioned in the attachment

Note: I am using java 1.4



[logic.PNG]

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4527
    
    5

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?


luck, db
There are no new questions, but there may be new answers.
Taleb Elm
Greenhorn

Joined: Jun 13, 2013
Posts: 6
My client is having a Java desktop application made with Java 1.4 and the client is not looking for update right now. However, I am good at Java but I don't have strong experience in the swing especially JTable.
Can you show me a small code to resolve my issue.
Appreciate your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I want to color text inside multiple JTextFields located inside JTable