FilteredRowSet size
- From: "Carl Leiby" <carl.leiby@xxxxxxxxx>
- Date: 2 Mar 2007 09:51:25 -0800
Hello,
I'm working on a Swing app. I want to show a pair of parent/child
JTables so that selection within the parent drives filtering in the
child. It seemed to me that FilteredRowSet would be ideal for this.
So I wrote a TableModel on top of a FilteredRowSet. I can vary the
filter and get different sets of information in the JTable.
It almost works. The problem is in my implementation of getRowCount.
It seems that FilteredRowSet doesn't override the CachedRowSet
implementation of size() to tell me how many rows are in the filtered
subset. calling last() and getRow() doesn't work cause I get the row
number relative to the superset of results.
The only way I see to make it work is to first() and next() till the
end and count the rows myself. That seems insane and terribly
inefficient. Am I wrong? Please tell me that there's a better way.
Thanks
.
- Follow-Ups:
- Re: FilteredRowSet size
- From: lipska
- Re: FilteredRowSet size
- From: kuassi.mensah@xxxxxxxxx
- Re: FilteredRowSet size
- Next by Date: NullPointerException in java.lang.FloatingDecimal.readJavaFormatString with Oracle driver
- Next by thread: Re: FilteredRowSet size
- Index(es):
Relevant Pages
|
|