How can I implement a RowFilter
between two dates? The dates are in string format. Is it necessary to change the format to a date format to apply a RegexFilter
?
I tried using the following, but failed :
DefaultTableModel model = (DefaultTableModel) easypath.masteBusiness_table.getModel();
easypath.masteBusiness_table.setModel(model);
TableRowSorter<TableModel> rowSorter = new TableRowSorter<>(easypath.masteBusiness_table.getModel());
easypath.masteBusiness_table.setRowSorter(rowSorter);
rowSorter.setRowFilter(RowFilter.regexFilter(startD+"\\s+(.*?)\\s+"+endD));
I know I am wrong with the filtering as (startD+"\\s+(.*?)\\s+"+endD));
is only for searching a single string but as a novice I would very much appreciate any suggestion.
UPDATE
I just saw this (http://docs.oracle.com/javase/7/docs/api/javax/swing/RowFilter.html) where RowSorter<M,I>
, M is the model and I is an integer value, which does not match my criteria