I want to display a JDialog
so I use this:
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() { new DialogBox().setVisible(true); }
});
It works fine to display it but then my JDialog
doesn't keep the focus, which it needs to (the user should not be able to work using the main UI while that dialog is open).
Is it safe to get rid of the SwingUtilities.invokeLater()
?
Oh and according to this question it is not wise to extend JDialog or JFrame, why? That's how I've always done it.