title: Java JTable filter data
body: <p>I can not correctly apply the filter to the JTable.</p>
  
  <pre><code>private static TableRowSorter&lt;SQLiteTableModel&gt; sorter = null;
  ...
  private void jTFSearchOtherKeyPressed(java.awt.event.KeyEvent evt) {                                          
  
      jTableOther.setRowSorter(sorter);
      String text3 = jTFSearchOther.getText();
      if (text3.length() == 0) {
          sorter.setRowFilter(null);
      } else {
          sorter.setRowFilter(RowFilter.regexFilter(text3));
      }
  } 
  </code></pre>
  
  <p>One table is sorted, the other gives an error</p>
  
  <pre><code> private void jTFSearchOtherKeyPressed(java.awt.event.KeyEvent evt) {                                          
          jTableOther.setRowSorter(sorter);
          String text3 = jTFSearchOther.getText();
          if (text3.length() == 0) {
              sorter.setRowFilter(null);
          } else {
              sorter.setRowFilter(RowFilter.regexFilter(text3));
          }
      }  
  
  Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 4
      at testovoezadanie.demo.SQLiteTableModel.getValueAt(SQLiteTableModel.java:137)
      at javax.swing.JTable.getValueAt(JTable.java:2719)
      at javax.swing.JTable.prepareRenderer(JTable.java:5720)
      at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114)
      at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016)
      at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812)
      at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
      at javax.swing.JComponent.paintComponent(JComponent.java:777)
      at javax.swing.JComponent.paint(JComponent.java:1053)
      at javax.swing.JComponent.paintChildren(JComponent.java:886)
  </code></pre>
  
  <p>On line 137</p>
  
  <pre><code>@Override
      public Object getValueAt(int row, int column) {
          return contents[row][column];
      }
  </code></pre>