RowFilter.regexFilter multiple columns
Posted
by twodayslate
on Stack Overflow
See other posts from Stack Overflow
or by twodayslate
Published on 2010-03-22T18:46:05Z
Indexed on
2010/03/23
19:13 UTC
Read the original article
Hit count: 1172
I am currently using the following to filter my JTable
RowFilter.regexFilter(
Pattern.compile(textField.getText(),
Pattern.CASE_INSENSITIVE).toString(), columns );
How do I format my textField
or filter so if I want to filter multiple columns I can do that. Right now I can filter multiple columns but my filter can only be of one of the columns
An example might help my explanation better:
Name Grade GPA
Zac A 4.0
Zac F 1.0
Mike A 4.0
Dan C 2.0
The text field would contain Zac A
or something similar and it would show the first Zac row if columns
was int[]{0, 1}
. Right now if I do the above I get nothing. The filter Zac
works but I get both Zac
's. A
also works but I would then get Zac A 4.0
and Mike A 3.0
.
I hope I have explained my problem well. Please let me know if you do not understand.
© Stack Overflow or respective owner