• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

I want to color text inside multiple JTextFields located inside JTable

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
[Thumbnail for logic.PNG]
Sample of the result I am looking for
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic