# Windows UI scaling not respected

**URL:** <https://discourse.processing.org/t/windows-ui-scaling-not-respected/45905>\
**Category:** Processing\
**Created:** [March 4, 2025, 8:34pm UTC](https://discourse.processing.org/t/windows-ui-scaling-not-respected/45905 "2025-03-04T20:34:04Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [June 30, 2025, 6:21pm UTC](https://discourse.processing.org/t/windows-ui-scaling-not-respected/45905/5 "2025-06-30T18:21:56Z")

</div>

Hello @esc746,

I just had the same issue!

**_NOTE_ :**  
Results may vary depending on version used!  
I was using Processing 4.3.4 (error checking works) and Processing 4.4.4 (error checking broken) and they give different results depending on renderer.

How to **disable scaling in JavaFX** so it behaves like Processing:

You may be able to (see comment above!) turn off automatic DPI scaling in JavaFX by setting a system property:

```auto
System.setProperty("glass.win.uiScale", "1");

```

The above only seemed to work when starting a new FX2D PApplet (minimal code):

```auto
// NOTE: 
// In W10 you also need to add the JavaFX JAR files to the sketch in a "code" folder. // Search forum for this discussion.

import processing.javafx.*;

// Corrected some "Type is ambiguous" errors
import javafx.scene.paint.Color;
import javafx.stage.Screen;

//Renderer Applets:
renderApp app; // FX2D

public void settings()
  {
  size(300, 300);
  }

public void setup()
  {
  // Testing:
  System.setProperty("glass.win.uiScale", "1"); // This works!

  //displayDensity(1); //If needed!
  surface.setVisible(true);
  surface.setLocation(10, 10);

  app = new renderApp();
  Thread thread = new Thread(() -> PApplet.runSketch(new String[]{"renderApp"}, app));
  thread.start();
  }

public void draw()
  {
  background(0, 255, 0);
  }

// FX2D
public class renderApp extends PApplet 
  {
  public void settings()
    {
    size(300, 300, FX2D);
    }

  public void setup() 
    {
    println(Screen.getPrimary().getOutputScaleX());

    surface.setVisible(true);
    surface.setLocation(320, 10);
    
    Stage primaryStage = new Stage();
    Pane root = new Pane();
    root.setBackground(new Background(new BackgroundFill(Color.RED, null, null)));
    Scene scene = new Scene(root, 300, 300);
    primaryStage.setTitle("JavaFX Window");
    primaryStage.setScene(scene);
    primaryStage.setX(600+30);
    primaryStage.setY(10);
    primaryStage.show();   
    }

  void draw()
    {
    background(255, 255, 0);
    }
  }

```

`:)`

---

_[View the full topic](https://discourse.processing.org/t/windows-ui-scaling-not-respected/45905)._
