How to keep the dialog always on top?

I created a dialog like this:

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

      

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

Do you have any ideas?

Thanks!

+2


a source to share


2 answers


In fact, using Java, having a system modal dialog is not possible. The best you can have is a modal toolbox capabilities panel. This is to say the options bar, which remains in front of all Java windows.



This example explains how Java6 allows you to do this.

+1


a source


I may not have a question, but I quickly created a desktop app with the code you posted and it is actually modal ...



0


a source







All Articles