tags:

views:

782

answers:

2
A: 

You can set the following options to an JDialog class

//setUndecorated(true);
setFocusableWindowState(false);
setFocusable(false);

For this you can ceate your own JDialog class. You only have to extend from JDialog and put the code into the Constructor call.

Markus Lausberg
+2  A: 

It looks like you want a simple model dialog (i.e. a dialog which pops up and doesn't allow the user to do anything else until it's closed). Java makes this really easy - just use JOptionPane's static methods to create the dialog you want.

Try replacing the callDialog function body with:

int result = JOptionPane.showConfirmDialog(frame, message, title,
               JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);

You'll have a yes/no dialog box appear over the frame which doesn't allow you to do anything with the frame until the user clicks on Yes or No.

If that doesn't meet your needs, try a call to frame.toFront() and that will bring the JFrame back into the foreground.

deterb