# App Icon Processing 4

**URL:** <https://discourse.processing.org/t/app-icon-processing-4/43918>\
**Category:** Coding Questions\
**Created:** [February 15, 2024, 7:29am UTC](https://discourse.processing.org/t/app-icon-processing-4/43918 "2024-02-15T07:29:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edenstudent](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@Edenstudent](https://discourse.processing.org/u/Edenstudent)\
**Post date:** [February 15, 2024, 7:29am UTC](https://discourse.processing.org/t/app-icon-processing-4/43918/1 "2024-02-15T07:29:53Z")

</div>

I’m trying to set the icon for the application (and in the task bar) in Processing4, and I have this:

```auto
  PImage icon = loadImage("icon.png");
  surface.setIcon(icon);

```

The image is 778x758; it doesn’t show up though in the program or task bar, so I’m not sure what to do here as this is the documentation:  
[https://processing.github.io/processing-javadocs/core/processing/core/PSurface.html#setIcon-processing.core.PImage-](https://processing.github.io/processing-javadocs/core/processing/core/PSurface.html#setIcon-processing.core.PImage-)

---

<div class="post-metadata">

**Author:** ![Edenstudent](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@Edenstudent](https://discourse.processing.org/u/Edenstudent)\
**Post date:** [February 15, 2024, 7:37am UTC](https://discourse.processing.org/t/app-icon-processing-4/43918/2 "2024-02-15T07:37:45Z")

</div>

Update, I’m using P2D and it appears to work for JAVA2D , however, it’s far too laggy for my image intense program and I need to use P2D… so, still not sure of the solution, but it appears that P2D is the issue here?

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [February 19, 2024, 8:08am UTC](https://discourse.processing.org/t/app-icon-processing-4/43918/3 "2024-02-19T08:08:14Z")

</div>

hi @Edenstudent,

there are restrictions on setting an icon for JOGL context and therefore it needs to be setup in settings instead of setup method…

Try this…

```auto
void settings() {
  size(500,500,P2D);
  PJOGL.setIcon(dataPath("icon.png"));
}

```

usually if you do this…

```auto
void setup() {
    size(500,500,P2D);
    surface.setIcon(loadImage("icon.png"));
}

```

… you should see an error message like below in the console output !?

```auto
Window icons for OpenGL sketches can only be set in settings()
using PJOGL.setIcon(filename).

```

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![Edenstudent](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@Edenstudent](https://discourse.processing.org/u/Edenstudent)\
**Post date:** [February 19, 2024, 9:30pm UTC](https://discourse.processing.org/t/app-icon-processing-4/43918/4 "2024-02-19T21:30:56Z")

</div>

Awesome, thanks so much, this worked perfectly!  
And no, it didn’t throw any errors or warnings, just did nothing.

---

<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:** [February 20, 2024, 3:23pm UTC](https://discourse.processing.org/t/app-icon-processing-4/43918/5 "2024-02-20T15:23:44Z")

</div>

> [@Edenstudent](#):
>
> And no, it didn’t throw any errors or warnings, just did nothing.

Hello @Edenstudent,

This is what I see with Processing 4.3 on W10:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/1/9/19fb79224158b5c02320b77f2218edbf7d3ea319.png)

Setting icon in settings():

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/9/0983e16212824bc1f2ccf64d5dadc7f5bad42a18.png)

How cool is that!

`:)`

---

<div class="post-metadata">

**Author:** ![Edenstudent](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@Edenstudent](https://discourse.processing.org/u/Edenstudent)\
**Post date:** [February 21, 2024, 6:57am UTC](https://discourse.processing.org/t/app-icon-processing-4/43918/6 "2024-02-21T06:57:54Z")

</div>

Oh, my mistake; I thought you meant warning in the errors list, not the console. It fills up so quickly when starting that I must’ve missed it, sorry
