This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Abstract Table Model row colours Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Abstract Table Model row colours" Watch "Abstract Table Model row colours" New topic

Abstract Table Model row colours

Mike Brooks

Joined: Oct 07, 2007
Posts: 14

Is there anyway to change a JTable row colour using the abstract table model not the default table modle cant find this information anywhere.

Thanks and regards
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2177
You ask lots of questions but never bother to read the answers. At least you never bother to reply stating whether the suggestions work or not. So I won't bother to answer the question so you don't have to worry about replying.
Zhui Shen Ge

Joined: Nov 22, 2009
Posts: 5
Using a custom cell renderer?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268

Zhui Shen Ge is correct.

I take it you are aware of MVC.
The model holds the data. It is not aware of any visual aspects of displaying that data. In fact the model even does not care how it's data is rendered. Check out the standard tutorial (The API docs have a link to it) on how to use JTables. Scroll down to the section which talks about renderers and editors.

In case you are wondering about Rob's reply, read

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Don't get me started about those stupid light bulbs.
subject: Abstract Table Model row colours