Search code examples
javaswingjtablerowfilter

JTable custom RowFilter?


RowFilter examples only do text comparison, but how does one filter rows that are linked to particular properties ?

my datamodel class

class MyDataModel
{
    private ArrayList<MyFile> data; // for the rows data 

...

class Myfile
{
   private boolean error; // file name issues
   private boolean ignored; // file ignored for process
   private boolean exception; // file processed no matter other conditions
...

so how do I filter the rows where the MyFile has some property to true (or even more complex tests on these fields)

thanks


Solution

  • What do you mean by text comparision? Have you added your filter and overridden include method?

    boolean include(RowFilter.Entry<? extends M,? extends I> entry) 
    

    The API document here RowFilter itself explains how you can filter based on integer/number or based on any property type