title: How can I hide a row in my JTable?
body: <p>I'm using Eclipse Indigo SR1 with JDK 1.7, on Windows 7 Pro.
  I've written a desktop app, Swing based.</p>
  
  <p>My app includes a JTable; it shows many records of type T, one row per record.
  The table model points to Vector vect, named vect, containing all data to be shown in the JTable.</p>
  
  <p>The app includes a combo, named sele, showing three values: 0, 1, 2.</p>
  
  <p>When sele = 0, every record of vect has to be visible in the JTable.</p>
  
  <p>When sele = 1, the JTable has to show only vect records having odd row index and all records with even row index mustn't be visible. Viceversa, when sele = 2.</p>
  
  <p>So, here's my question: how can I make a row not visible in the JTable ?
  I can't use the table model, because it points to vect that contains "all" data.</p>
  
  <p>I tried a table cell renderer, but it seems that you can set the color of a cell, but you can't set it not visible or modify its size.</p>
  
  <p>I've tried another way: if r is the row index, and I want that row to be not visible, I write table.setRowHeight(r,0), but this instruction throws an exception, the height can't be set to zero.</p>
  
  <p>I could solve the problem by splitting the data, dividing vect in two, but I don't like that.</p>
  
  <p>Does anybody have an idea ?</p>
  
  <p>thanx in advance,
  William</p>
  
  <p>PS: someone told me to create a filtering TableModel that wraps the existing TableModel. The filtering model would be sensitive to the filtering criteria and fire the appropriate methods (TableDataChanged) when the filter was changed. The getRowCount method would return the filtered count. The getValueAt method would map the filtered row to the actual row in the underlying TableModel.</p>
  
  <p>Mah, perhaps it's a good idea, but frankly I'm not able to understand it...</p>