views:

48

answers:

2

I created a dialog box like this:

String response = 
JOptionPane.showInputDialog(null,"message","title",JOptionPane.PLAIN_MESSAGE);

I'd like to keep it always on top of all windows.

Do you have any idea?

Thanks!

+1  A: 

In fact, using Java, having a system modal dialog is not possible. The best you can have is a toolkit modal option pane. That's to say an option pane that stay in front of all Java windows.

This example explains how Java6 allows you to do that.

Riduidel
A: 

Maybe I don't get the question, but I quickly created desktop app with code you posted and it actually is modal ...

Xorty
Modal to the application, not the system. He wants it modal on the system.
Gnoupi
ahhh, I see ....
Xorty