Why does Java show a worse result when using the same Processing code?

94 Views Asked by At

I have written the exact same code twice, once in the Processing (4.3) IDE and once in Eclipse using the core.jar file. In both IDEs the code results in a rectangle with rounded corners on a white background. But the quality of the rectangle is way worse using eclipse and the window is also bigger despite using the same window size. (Windows version: 10.0.19045 Build 19045) (Eclipse version: 2023-03 (4.27.0))

Code in Processing (4.3) IDE

final static int screen_width = 1400;
final static int screen_height = 600;
final static int button_width = 500;
final static int button_height = 200;
final static int border_width = 8;

PVector button_startingpoint;


public void settings() {
  size(screen_width, screen_height);
}

public void setup() {
  frameRate(60);
  button_startingpoint = new PVector((screen_width / 2) - (button_width / 2), (screen_height / 2) - (button_height / 2));
}

public void draw() {
  background(255);
  fill(255, 255, 255);
  strokeWeight(border_width);
  rect(button_startingpoint.x, button_startingpoint.y, button_width, button_height, 24);
}

Code in Eclipse

package main;

import processing.core.PApplet;
import processing.core.PVector;

public class Startup extends PApplet {
    final static int screen_width = 1400;
    final static int screen_height = 600;
    final static int button_width = 500;
    final static int button_height = 200;
    final static int border_width = 8;

    PVector button_startingpoint;

    public static void main(String[] args) {
        PApplet.main("main.Startup");
    }

    public void settings() {
        size(screen_width, screen_height);
    }

    public void setup() {
        frameRate(60);
        button_startingpoint = new PVector((screen_width / 2) - (button_width / 2), (screen_height / 2) - (button_height / 2));
    }

    public void draw() {
        background(255);
        fill(255, 255, 255);
        strokeWeight(border_width);
        rect(button_startingpoint.x, button_startingpoint.y, button_width, button_height, 24);
    }

}

Result in Processing (4.3) IDE:

Result in Processing (4.3) IDE

Result in Eclipse:

Result in Eclipse

0

There are 0 best solutions below