Solution on my system with Windows 10 and Windows Scaling = 125% :
DPI Renderer Scaling Override for JAVA2D
This is a workaround on my system for fullscreen(P2D) :
/*
* Fullscreen P2D Workaround
*
* Author: glv
* Date: 2025-11-09
*
*/
static
{
// Forces 1:1 pixel rendering by disabling OS-level DPI scaling
System.setProperty("sun.java2d.uiScale", "1.01"); // If this is 1.0 it does NOT work!
//System.setProperty("sun.java2d.DPIscaling", "false"); // No effect.
}
void setup()
{
//size(1920, 1200, P2D);
fullScreen(P2D, 2); // 0 is span, 1 is monitor 1, 2 is monitor 2
println(SPAN);
println(width, height);
//surface.setLocation(50, 50); // Does NOT work with monitor 2 and will go to monitor 1!
}
void draw()
{
// Helps to see the size of the screen:
circle(50, 50, 50);
circle(width-50, 50, 50);
circle(width-50, height-50, 50);
circle(50, height-50, 50);
circle(width/2, height/2, 50);
}
I came across this quite accidentally exploring this a few days ago!
It has to be at least one pixel off to work and you will see this in the println(width, height); output.
:)