java - Filter and search in jtable netbeans -
i still new in java; create 1 search or filter textfield find database in jtable code search lowercase. how can make coding can filter lower , upper case?
here code:
private void jtextfield1keyreleased(java.awt.event.keyevent evt) { defaulttablemodel table = (defaulttablemodel)jtable_mosquemanagementsystem.getmodel(); string search = jtextfield1.gettext().tolowercase(); tablerowsorter<defaulttablemodel> tr = new tablerowsorter<defaulttablemodel>(table); jtable_mosquemanagementsystem.setrowsorter(tr); tr.setrowfilter(rowfilter.regexfilter(search)); }
try given pattern removing tolowercase() method string
rowfilter<tablemodel, object> filter = rowfilter.regexfilter(pattern.compile(lookup,pattern.case_insensitive).tostring(),0,1);
for further modifications follow given link
https://coderanch.com/t/498043/java/jtable-rowfilter-case-insensitive
Comments
Post a Comment