Solved

jtable change row color

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

615 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