我完成了我的过滤器搜索并将行索引转换为模型。现在我的问题是如何在搜索时接受大写和小写字母?
P.S。我正在使用搜索我的JTable
private void filter(String query)
{
DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
TableRowSorter<DefaultTableModel> sort = new TableRowSorter<DefaultTableModel>(model);
jTable1.setRowSorter(sort);
sort.setRowFilter(RowFilter.regexFilter(query));
}
private void jTextField1KeyReleased(java.awt.event.KeyEvent evt)
{
int[] selection = jTable1.getSelectedRows();
for (int i = 0; i < selection.length; i++) {
selection[i] = jTable1.convertRowIndexToModel(selection[i]);
String query = jTextField1.getText();
filter(query); }
}