I have a JFrame I switch being displayed between two monitors. The monitor on the left (Windows sees it as display 2) has a resolution of 1920x1080 and my code to move the JFrame is:
setLocation(0,0)
setSize(1920, 1080)
and this works just fine with the frame perfectly center on the monitor. However on the right monitor (Windows sees it as display 1) it has a resolution of 1600x900 and the code for that is:
setLocation(1920,74)
setSize(1600, 900)
and I have to have the '74' in there otherwise the frame will not fit perfectly in the monitor. If I do setLocation(1920,0) part of the frame is missing on the top of the monitor. My question is what(why?) exactly is the number 74 and how do I calculate it for other resolutions?