I want to execute a function in java, but meanwhile I want to show a JOptionPane
to the user when the operation starts and when it ends, the problem is that if I don't push the "Accept" buyton of the first JOptionPane
, my function doesn't starts, I'd like it to be automatically, how can I do that? here's my code, I'm using JRI interface for my function.
JOptionPane.showMessageDialog(null, "Leyendo archivos, espere un momento...","Importar archivos cel", JOptionPane.INFORMATION_MESSAGE);
REXP data = re.eval("rawdata <- read.celfiles(celFiles)");
JOptionPane.showMessageDialog(null, "Se han importado las muestras exitosamente.", "Importar archivos cel",JOptionPane.INFORMATION_MESSAGE);
Use
ExecutorService
, i believe it should be easier to implement if understood. example,You can use other of its overloaded methods to your convenience. see documentation