title: Java GUI hangs upon click of button
body: <p>I am doing an update form. The update button hangs once I click it, but the data still gets successfully updated in my database.
  My code is</p>
  
  <pre><code>String url = "jdbc:derby://localhost:1527/Members";
  String username = "admin1";
  String password = "admin1";
  
  String query = "UPDATE BOOKINGDATA SET BOOKINGREF = ?, MEMBERID = ?, NAME = ?, CONTACT = ?, EMAILADDRESS = ?, RESERVATIONDATE = ?, RESERVATIONTIME = ? WHERE BOOKINGREF = ?";
  
  try (Connection con = DriverManager.getConnection(url, username, password);
      PreparedStatement ps = con.prepareStatement(query)) {
  
      ps.setString(1, txtBookingRef.getText());
      ps.setString(2, txtMemberID.getText());
      ps.setString(3, txtName.getText());
      ps.setString(4, txtContact.getText());
      ps.setString(5, txtEmail.getText());
      ps.setDate  (6, new java.sql.Date(comboDate.getDate().getTime()));
      ps.setString(7, comboTime.getSelectedItem().toString());
      ps.setString(8, txtBookingRef.getText());
  
      ps.executeUpdate();
  
      JOptionPane.showMessageDialog(null, "Booking updated");
  
  } catch(SQLException ex) {
      JOptionPane.showMessageDialog(null, ex.toString());
  }
  </code></pre>
  
  <p>Any ideas?</p>