Rediaplay hided rows do not show unless resizing in JTable
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Yuan
Posted On:   Friday, June 15, 2001 04:08 PM

Hi, I have an intrigue problem regarding JTable usage in JDK1.3. I have a FilteredTableModel (it is a decorator of the RealTableModel that maintains all records) that can enable/disable filtering (hiding) certain rows. In most cases it works OK. If the filter is enabled, method getRowCount() returns number of rows that are not filtered and method getValueAt() will remap the row index (get the actual row index in the RealTableModel) before it returns the real value in the real table model so that the hided rows will not be returned. But it shows strange behaivor in the following scenario, I enable filter and rows displayed shrink from 16 to, say, 10. Then I drag the edge of the window frame and resize it a little bit and the number of rows    More>>

Hi,

I have an intrigue problem regarding JTable usage in JDK1.3. I have a FilteredTableModel (it is a decorator of the RealTableModel that maintains all records) that can enable/disable filtering (hiding) certain rows. In most cases it works OK. If the filter is enabled, method getRowCount() returns number of rows that are not filtered and method getValueAt() will remap the row index (get the actual row index in the RealTableModel) before it returns the real value in the real table model so that the hided rows will not be returned.

But it shows strange behaivor in the following scenario, I enable filter and rows displayed shrink from 16 to, say, 10. Then I drag the edge of the window frame and resize it a little bit and the number of rows displayed is still 10. Next I disable the filter. Now the getRowCount() returns 16 but the JTable only shows the first 10 rows. It shows all 16 rows only after I have to resize the window again.

I do have the repaint() method called of the JTable component after each time I disable/enable the filter.

Thanks,

David Yuan

   <<Less

Re: Rediaplay hided rows do not show unless resizing in JTable

Posted By:   David_Yuan  
Posted On:   Friday, June 15, 2001 04:42 PM

Problem Solved.


I apologize the question got posted in the Security zone. Could the forum maintainer please remove this question?



Thanks,



David Yuan

About | Sitemap | Contact