开发者

How do I keep a dialog box always on top?

开发者 https://www.devze.com 2022-12-27 10:13 出处:网络
I created a dialog box like this: String response = JOptionPane.s开发者_如何学JAVAhowInputDialog(null,\"message\",\"title\",JOptionPane.PLAIN_MESSAGE);

I created a dialog box like this:

String response = 
JOptionPane.s开发者_如何学JAVAhowInputDialog(null,"message","title",JOptionPane.PLAIN_MESSAGE);

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

Do you have any idea?

Thanks!


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消