i have a program which searches the price, description by entering barcode. i want to time the search field to hold the results of one request for only 5 seconds and be ready for the next user request. i have tried using timer but i think i do know to that kindly help. am using net beans Jframe key released event. here is my code:

private void txt_barcodeKeyReleased(java.awt.event.KeyEvent evt) {

try{
String sql="select * from prod_mast where barcode=?" ;
pst=conn.prepareStatement(sql);
pst.setString(1,txt_barcode.getText());

rs=pst.executeQuery();
if(rs.next()){
String add1 = rs.getString("item_des");
txt_description.setText(add1);
String add2 = rs.getString("retail1");
txt_price.setText(add2);


}



}catch(Exception ex){
JOptionPane.showMessageDialog(null, ex);


}

}