Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TableSorter (Can you skip a column?)  RSS feed

 
Adam Altmann
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm working with JTables (It's good stuff.) and am using TableSorter to add cool, column-sorting goodness to my application. It works. It's fantastic. I get giddy just thinking about it.

My problem lies in the fact that I'd like to have a nifty little column on the left which holds the row number (like any spiffy database/spreadsheet thingie should). I'd like these to remain starting at 1 and incrementing per record...you know the deal. So, what I have to do is figure out how to get TableSorter to skip that particular column.

When I look at the TableSorter code, I'm "Like, woah." Can anyone point me in the right direction?

Thanks.

-Adam
 
Adam Altmann
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OR,

Since I may be doing things the Hard Way. Is there a way to get a JTable to show row numbers? I'm looking through the API as I type, but I'm not seeing anything.

Thanks again,

-Adam
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can mess about with row headers in JTables but in my experience can get messy. The simplest thing to do would be to fix the problem in your TableModel. For instance in your TableModel code :


hope that helps.
D.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!