File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 2447
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: 10824

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!]
I agree. Here's the link:
subject: Abstract Table Model row colours
It's not a secret anymore!