title: Automatically filter JTable once QR is scanned
body: <p>I am  trying to make an attendance system with QR generator and scanner using zxing. QR part is working fine but I have one problem right now. When the QR code get scanned, I want it to automatically filter the table/database with the same serial number through textfield (I am using setText to pass the text on QR to textfield.</p>
  <p>Code for Filter:</p>
  <pre><code> try {
              con = DriverManager.getConnection(&quot;jdbc:mysql://localhost/studentlogin&quot;, &quot;root&quot;, &quot;&quot;);
              String sql = &quot;SELECT * FROM studentqrlogin WHERE &quot; + &quot;SN like '%&quot; + tfSearch.getText() + &quot;%'&quot;;
              pst = con.prepareStatement(sql);
              rs = pst.executeQuery();
  
              jtTable.setModel(DbUtils.resultSetToTableModel(rs));
  
          } catch (Exception e) {
              JOptionPane.showMessageDialog(null, e);
          }  
  </code></pre>
  <p>So far, I have this code on  a key released event. I also tried adding it to other event listener but it doesn't work like I want it to be.</p>