• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JTable RowFilter by row number

Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Jave 1.4, I wrote my own JTable subclass (NTable) to implement filtering, sorting, column resizing, etc.

I made my NTable capable of filtering by explicit row number. This worked great. My application was responsible for determining which rows should be filtered based on content (or if the user just wanted to hide a specific row), and it passed the row numbers to NTable to actually filter.

Now with Mustang/6.0 Java, the filtering/sorting is finally provided. HOWEVER, the combination of generics (which still hurt my head) and the apparent lack of a row number parameter make it impossible to filter specific rows. Or so it seems to me. Am I wrong?

If the user selects the fifth row and clicks the "filter" button, can I use RowFilter to get rid of that particular row and no others? Or do I need to roll my own again?

I have to do this anyway in order to properly add in the column resizing and HTML-enabled cells (requiring multi-line, or variable-width, rows). But it seems a waste to completely ignore the new filtering/sorting package just because of one stupid little oversight.

Posts: 23377
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This thread contained some comments about the naming policy that has been moved to the JavaRanch forum.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic