File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jtable Row color

 
Shashika Thiran
Greenhorn
Posts: 24
  • 0
  • 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: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic