java programming

I am adding a row to a jtable and depending on the typeEntry[type], I would like to have the row that was just added be a different color.  The code I use to add each row is below.

                            airTable.insertRow(ii,new Object[]{ hour,
                                audiorec.getString("artist"),
                                audiorec.getString("title"),
                                "",
                                cat,
                                typeEntry[type]});
                                ii++;
sargent240Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
0
sargent240Author Commented:
I have looked at a lot of web sites and am struggling to get wrapped around a solution to my problem.  Could you give me a little sample code that would give me an end result?  THANKS!
0
CEHJCommented:
There's sample code at the link i posted
0
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

sargent240Author Commented:
Well, I looked at the code and read the documentation but I must admit I have no idea how renderers work.  No idea how the sample code would interface with mine.
0
zzynxSoftware engineerCommented:
A TableCellRenderer, as its name says, renders the content of a table cell. That is: it determines how the data in the table's cells will be represented.

>> I would like to have the row that was just added be a different color.
First, you need to think about the question "What determines the color a row has to be drawn in?"
0
sargent240Author Commented:
Back at it I see how to color a col.  How do I change the color for the whole row?
0
zzynxSoftware engineerCommented:
No doubt this will help you (code is available and downloadable):
http://tips4java.wordpress.com/2010/01/24/table-row-rendering/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sargent240Author Commented:
Thanks!
0
zzynxSoftware engineerCommented:
You're welcome. Glad it helped.
Thanx 4 axxepting
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.