Solved

jtable change row color

Posted on 2006-11-07
1
599 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

828 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