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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -