To be able get dpi value, I am using this:
float dpi = Toolkit.getDefaultToolkit().getScreenResolution();
In advance display settings, When I applied 1366 x 768 as a resolution value;
dpi
value returns 96
(That is what I expected)
However, When I changed 800 x 600 as a resolution value in settings;
dpi
value returns 96
(That should be lower value than 96
)
When I try same case in mac computer, the right values are coming.
I think there is something wrong in the resolution value which comes from Windows OS. I have tested for Windows 7 and Windows 10.
Edit : To understand why I need this value, check this question and its answer.