This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jtable Row color

 
Shashika Thiran
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11185
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic