I've discovered an issue with Windows 10 and Java.
JFrame frame = new JFrame();
frame.setVisible(true);
When I create a new JFrame and show it on the screen, it normally should have the screen coordinates x=0 and y=0. It actually does have those coordinates on windows 10.
But, what is really ugly, is, that it seems all windows in Windows 10 have some kind of "invisible" borders around them. So in this case it looks like the position of the Window is x=7 and y=0:
This is only a simple case where it just looks so ugly. My software has some logic which will "snap" one window onto another when you drag it in the near of the other one. I think you can imagine how ugly it looks if theres a (2*7px=) 14px space between the two windows altough it should be shown for the user as "linked" or "snapped" together.
On Windows 7 this has worked perfectly!
So does somebody know this problem and have any idea, how a workaround could be possible? I think of maybe finding out the current name of the windows theme and operating system name. And if it is "Aero" and "Windows 10", always just calculate x positions with -7px. Would that be somehow possible? Or maybe directly finding out what is the width of the invisible area?
Thanks for any idea about this topic.
getInsets()
method, but I don’t know how to detect whether that border is actually transparent. – Ottie