I am writing a plugin for intellij. I am launching a JDialog when a menu item is clicked. The problem is that the JDialog opens at the top left corner of screen. I tried using setLocationRelativeTo(null) but it placed the dialog at the center of the first screen while the intellij IDE was open on some other screen.
An answer here says how to use GraphicsEnvironment api to position a Window in a particular screen, but then how do I specify which screen the intellij IDE is launched in.