How to change the icon of your application using PJOGL.setIcon()?

Hello there. I’m writing an application in processing, and I want to change application’s default icon on the taskbar.

I know how this can be done by using surface.setIcon(PImage). But this doesn’t work when I’m using P3D, or P2D because I get this error:

But when I use PJOGL.setIcon(filename), the image never replaces the default application image with the image I want, despite it being in the sketch’s data folder (I don’t get any errors either). Is there any reason why this is happening?

EDIT: I am so sorry, I made a very silly mistake :upside_down_face: . I didn’t read the whole error. I managed to fix this by doing this:

void setup() {
  
}
void settings() {
  size(100, 100, P3D);
  PJOGL.setIcon("Sketch_Icon.png");
}

instead of this:

void setup() {
  //PImage image = loadImage("Sketch_Icon.png","png");
  size(500, 500, P3D);
  PJOGL.setIcon("Sketch_Icon.png");
}
1 Like

Woah, this even helped me, thanks!

1 Like