This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Jtable Row color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtable Row color" Watch "Jtable Row color" New topic
Author

Jtable Row color

Shashika Thiran
Greenhorn

Joined: Jan 22, 2009
Posts: 24
I have two Questiions.
Is there anyway to add data to jtable row by row?
I want to change the jtable some rows color when condition applied.How how do i do that?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10744
    
    9

Check out DefaultTableModel. It has methods like addRow and insertRow which you can use.
You will need to provide a renderer for a table where you can define the background.

In case you are a newbie to swing, you might want to read this first
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Jtable Row color
 
jQuery in Action, 3rd edition