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");
});