aspose file tools*
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: 10519
    
    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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Jtable Row color