I'm currently programming a little Java game and I use the JOptionPane
class to alert the user if an IOException
is thrown. I'd like to know how to prevent the option pane from being "closed" by clicking anywhere else, e.g. on the desktop, because it actually doesn't end the Java process.
If you want to have you window always visible (regardless of the other windows) there is an option called alwaysOnTop
, when you set that to true, the host OS will try to honour that directive displaying the window always.
Try to see if these posts helps: