Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to color text inside multiple JTextFields located inside JTable

 
Taleb Elm
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sample of the result I am looking for
[Thumbnail for logic.PNG]
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Taleb Elm
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic