title: Update Label text while button click action executing (Java)
body: <p>I have a button and Label on JFRAME.
  Clicking on button try to connect linux Server and this takes few second.
  I want to set the label text Connecting.. and Connected.But this doesn't set the label text Connecting .. during the button operation executing. Any Idea how to do that</p>
  
  <pre><code>private void buttonLConnectActionPerformed(java.awt.event.ActionEvent evt) {
      labelLOut.setText("Connecting");
      String ip="";
      String userid="username";
      String password="password";
  Main_Window.LBoxconnect=new SshConnection(ip,userid,password);
      int x=LBoxconnect.checkConnection();
      if(x==1){
      labelLOut.setText("Connected");
      if(dx==1)
          buttonBTTInsert.setEnabled(true);
      else
          lx=1;
      }
      else
      labelLOut.setText("Connection Failed");
  }  
  </code></pre>