Solved

jtable change row color

Posted on 2006-11-07
1
567 Views
Last Modified: 2008-02-01
I have a jtable and a button a dialog.  the number of rows in the table is different every time the application is run.  What i want to do is, when the button is clicked it runs a process and completes.  when it finishes and a boolean is set true (if false do nothing) then i want to see which row is selected and change every row 's background to red that comes after the selected row.

So far I see no easy way to change the background of individual rows in a jtable so i'm assuming i'll need to use a renderer of sorts.  Does anyone know how i can achieve this?
0
Comment
Question by:tbboyett
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 400 total points
ID: 17892820
heres an example of that sort of thing

http://www.objects.com.au/java/examples/swing/ColoredTableCell.do

u can probably simplify it a bit for your needs :)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now