0

i have created a desktop application using java swing...in this application when an user click the send button i want to show a "loading indicator" message dialog and when the process is finished close the dialog here is my send button

send.addActionListener((e) ->
{
    int idpos=Search.searchId(teid.getText().trim());
     ArrayList<Registration> list1;
     try{     
     list1=UserDataReadWriteFromFile.readDataFromFile();
         String e_pass=  list1.get(idpos).getPassword();
            SendPass send_pass    =   new SendPass();
       send_pass.sendPass("bond007@gmail.com", teid.getText().trim(), "Your Forgotten Password is",e_pass);
     }
     catch(Exception ex)
     {
         System.out.println(ex);
     }
       System.out.println("successful");

});
T.Rashid
  • 43
  • 8
  • 2
    I'd start by having a read through [Worker Threads and SwingWorker](https://docs.oracle.com/javase/tutorial/uiswing/concurrency/worker.html) – MadProgrammer Jan 11 '17 at 06:33
  • 1
    For [example](http://stackoverflow.com/questions/25418694/opening-jdialog-with-swingworker/25419069#25419069) and [example](http://stackoverflow.com/questions/14113644/java-global-reusable-loading-dialog/14114663#14114663), – MadProgrammer Jan 11 '17 at 06:36

0 Answers0