I want to display the user a dialog box with a text (JLabel). In the same method, were i create the dialog, i start to scan a file. After the file scan is complete the dialog should be closed. It sounds easy, but i have a problem. JLabel will not display the text, i tried a second thread for gui and for the file scan, but i never saw the text. When i forgotten the dispose for the dialog, the text will appear after the file scan. Where is my mistake?? Thanks Michael
Swing and threads don't get a long very well. Especially when it comes to I/O. The only thing you can do is put the File read in the Thread. But it probably won't work. I/O is a processor hog. And so it Swing to an extent. you could try this though. Create your Dialog, then call your thread, but call a sleep method inside your thread first, maybe that will give the GUI time to draw itself before I/O takes control of your processor. Good Luck!!