2

I would like to have some exemple of implementation of jXSearchPanel with jTable. I didn't find something on the web.

Thank you in advance,

Best Regards,

Florent

Delildor
  • 346
  • 4
  • 13

3 Answers3

1

I have successful implement the jxsearchpanel with jtable. This is my code:

    TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
    jTable1.setRowSorter(sorter);
    Pattern pattern = jXSearchPanel1.getPattern();
    sorter.setRowFilter(RowFilters.regexFilter(pattern, 0));
Delildor
  • 346
  • 4
  • 13
0

How about the official one?

You can download source from this java net project.

Rekin
  • 9,731
  • 2
  • 24
  • 38
  • Thank you for your answer, but the official one doesn't show an example of the implementation of jxsearchpanel. If someone has code that show the implementation of this component with jTable, it's will be very helpful. Thank you in advance – Delildor Aug 30 '10 at 09:14
0
JXSearchPanel pnlSearch = new JXSearchPanel();

        pnlSearch.setBounds(10, 6, 503, 45);
        pnlSearch.addPatternMatcher(new PatternMatcher() {

            @Override
            public void setPattern(Pattern p) {
                TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
                tblUser.setRowSorter(sorter);
                Pattern pattern = p;
                sorter.setRowFilter(RowFilters.regexFilter(pattern, 0));

            }

            @Override
            public Pattern getPattern() {
                return null;
            }
        });
realpac
  • 537
  • 6
  • 13