I have an application that uses the JOptionPane.show* to inform the user about various conditions before displaying the main application window. When setting up multiple screens, they are always displayed on the first screen. This is usually a minor annoyance, but it becomes a problem when screen 0 is turned off or off.
Normal windows can be positioned correctly using the resulting GraphicsConfiguration via MouseInfo , but I cannot find a way to pass this to JOptionPane . I can not use the main window to bind dialogs, because there is no main window at this stage of the application launch. Among the possible dialogs there is a warning about outdated versions of Java, therefore, displaying the main window before errors is not an option, since the java user environment may not even be able to display the main window.
Is there a way to specify the target screen without overriding the main body of JOptionPane ?
source share