Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable manipulations

 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I want to know how can I enable sorting by clicking on the header of a JTable column.

I want to change the color of a Row in the table depending on the value of a column .

can any body help me in doing these 2 things.

thanks a lot.

regards
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody can help me hereeeeeeeeee ? I am really sorry, I suck at GUIs...

thanks in advance.

regards,
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> how can I enable sorting by clicking on the header of a JTable column.

use TableSorter

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting


> change the color of a Row in the table depending on the value of a column.

use a custom renderer
(if unsure, search for row color, row highlight etc. - numerous examples here, sun, google)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic