Can Java display a dialog without changing the active window?

后端 未结 1 1039
情深已故
情深已故 2021-01-19 11:50

I\'d like to display a modal (progress) dialog above a Frame, even if that Frame isn\'t the active window. However, displaying a dialog causes it

相关标签:
1条回答
  • 2021-01-19 12:38

    I don't think you can do this with a modal dialog.

    However the following works for a non-modal dialog:

    dialog.setFocusableWindowState( false );
    dialog.setVisible(true);
    dialog.setFocusableWindowState( true );
    

    When the dialog displays it will not have focus, but if you click on it, it will gain focus. You could try this on a modal dialog to see what happens.

    0 讨论(0)
提交回复
热议问题