Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jtable change row color

Posted on 2006-11-07
1
Medium Priority
?
627 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 1600 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

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…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

715 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