I am having an issue using this method:
Toolkit.getDefaultToolkit().getScreenSize()
I am coding an application in Java using Swing that must be compatible with any screen resolution, because it will be an application for desktop and mobile devices. I've been reading about how to retrieve the screen resolution and everybody refers to this method. I've used it and for my recommendable screen resolution (1920x1080) it works fine, but I realized that, when I change the screen resolution of my monitor (I am working on a laptop) sometimes the ethod does not retrieve the correct screen resolution specified (and yes, I confirm the changes when I change the screen resolution from the Windows configuration).
I've read about the method but I realized that it is not useful for what I am trying to do (I think):
Toolkit.getDefaultToolkit().getScreenResolution()
My curiosity has led me to check the retrieved values of the method Toolkit.getDefaultToolkit().getScreenSize() and I've made this table:
My question here is, how can be this possible? Is this a bug or there is something more to do to retrieve the correct screen size always? I don't understand why I am not getting the correct values always
