• 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

Can JTable support hide or display a certain of rows?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if the DefaultTableModel has five rows,but i want to display two rows only,how can i do?i don't want to use the fireTableRowsDeleted(int firstRow,int lastRow) or removeRow(int row),because i need these later.now i solve like below:
1 create a MyTableModel implements Cloneable
2 once i need certain display,i clone a MyTableModel object,so i use fireTableRowsDeleted(int firstRow,int lastRow) or removeRow(int row) based my conditions with cloned object,then setModel use the model.
it can run,but lack performance.how can i do?
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
u can use setRowCount() to control your table row's count
reply
    Bookmark Topic Watch Topic
  • New Topic