I have Jpanel which is maximized on a button click. I do it by setting the dimensions to the screensize and then calling setLocationRelativeTo(null). This works fine if i have the panel in primary monitor, but when the panel is on other monitor the button click always makes the panel to move to primary monitor. Is there a way to get the currently used monitor of the panel and use the same for new location. Thanks in advance.
Share
I have only one screen at home and will be back to my job monday, but the following code set the title of the JFrame to “\Display0” under Windows Seven 64 bits. I suppose this string is the ID of the Screen and the second Screen is named “\Display1”.
I suggest to run this application on multi-screen PC to evaluate it.