vijay
vijay

Reputation: 1139

The TableFilterDemo.java is not working

I am learning how to add filter to JTable, so I found tutorials in sun website

http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TableFilterDemoProject/src/components/TableFilterDemo.java

I copied the code to netbeans, the code complied and run successfully, but when I enter "jane" in filtertext the table data just disappears instead of showing that row.

Looking for help thank you.

Upvotes: 1

Views: 87

Answers (1)

PbxMan
PbxMan

Reputation: 7623

It's case sensitive. Type "Jane"

Good luck

UPDATE

If you want to make it case insensitive the (?i) works fine before the Regex so change this line

rf = RowFilter.regexFilter(filterText.getText(), 0);

like this.

rf = RowFilter.regexFilter("(?i)"+ filterText.getText(), 0);

Good luck!

Upvotes: 5

Related Questions