We use FileDialog for open/save menus. When we save the file, first we populate the modal window using FileDialog. After user inputs the file name, the saving operation takes a long time ( up to 45 seconds) as there is a time consuming export process involved. So the problem is, during the export process, the FileDialog window is closed but there is a gray area in the FileDialog's location. Until the saving process is completed, the gray area will be cleared. Code is:
File file = null;
File fd = new FileDialog(mainFrame, "Save", FileDialog.SAVE);
fd.setDirectory("./");
fd.setLocation(50, 50);
fd.setVisible(true);
if (fd.getFile() != null) {
file = new File(fd.getDirectory() + fd.getFile());
}
// This is a time consuming process
ExportFromDB edb = new ExportFromDB();
// Program continues
Is there any way to clear the FileDialog window completely? thanks