title: Implementing java gui login using multithreading
body: <p>I am working on a java application which has a login form in a jframe. I have text fields and buttons in it. </p>
  
  <p>The login button has an eventlistener which is an <strong>inner-class</strong> of the class that creates the login window.  When user presses the login button, the listener takes the values form the fields and passes it to a validator which validates it using a mysql database and returns true and false based on the input by user. Now based on the return value the listener updates the ui using the <code>if-else</code> statement. This whole thing is working is fine.</p>
  
  <p>The problem is that when the validation is being carried out the gui cannot be used, because every thing is being done with a single thread. So for that time the <code>gui</code> is kind of freezed.
  How can I use multithreading to avoid this problem and use other gui components while validation is carried out.</p>