• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable RowFilter by row number

 
Greenhorn
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.

Help!
 
Trailboss
Posts: 23773
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic