Where TafelView is my new screen (JDialog)
Unfortunately, these lines won't run, because it stops on the line that makes the JDialog:
How can I do it so that these lines will run?
A Dialog window is an independent subwindow meant to carry temporary notice apart from the main Swing Application Window.
The Swing Tutorial: How to make Dialogs.
so they pause the execution of the thread they are spawned from.
If you don't want to wait for user input, I believe you'll want to use another Frame (or InternalFrame, if you want to block input to the main frame).
Besjamain Greenaway wrote: I first did it with a JFrame, but was advised to use a JDialog instead.
I looked through your previous posts for that advice and couldn't find it. Why was a JDialog advised over a JFrame?
Wouldn't you be better off having a JDialog sitting above the main JFrame rather than a second JFrame? Then there is absolutely no danger of closing the app when the dialog closes, you can better control modality type, and you can guarantee that the subwindow always sits above the main one.
I read about it somewhere else as well, but I can't find it that quick, although I have a hunch that I read it on Sun's website somewhere. But I'm guessing that you say that it's okay?
I would not say using JDialog is "OK". It doesn't do what you want it to do. I think you have two options (there may be more):
1. use a JDialog with the understanding that processing in that thread halts
2. use a second JFrame or a JInternalFrame and continue processing in the background.