# G4P new windows. How to change the icon in'P2D Mode'?

**URL:** <https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535>\
**Category:** Libraries\
**Created:** [October 12, 2020, 11:54am UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535 "2020-10-12T11:54:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [October 12, 2020, 11:54am UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535/1 "2020-10-12T11:54:52Z")

</div>

> import g4p\_controls.\*;  
> GWindow window;
> 
> import javax.swing.JFrame;  
> import java.awt.Font;  
> import com.jogamp.newt.opengl.GLWindow;
> 
> public void setup() {  
> size(256, 128);
> 
> createWindows();  
> }
> 
> public void draw() {  
> background(240);  
> }
> 
> public void createWindows() {
> 
> ```
> window = GWindow.getWindow(this, "설치 사이트", 100, 100, 1500, 800, P2D);
> window.setActionOnClose(GWindow.CLOSE_WINDOW);
> //JFrame frame = (JFrame) ((processing.awt.PSurfaceAWT.SmoothCanvas) window.getSurface().getNative()).getFrame();
> //frame.setIconImage((java.awt.Image) loadImage("icon.png").getNative());    
> GLWindow winGL = (GLWindow) window.getSurface().getNative();    
> frame.setIconImage((java.awt.Image) loadImage("icon.png").getNative());
> window.addDrawHandler(this, "windowDraw");
> window.addMouseHandler(this, "windowMouse");
> 
> ```
> 
> }

G4P new widows. How to change the icon in’P2D Mode’?

I want to change the’processing icon’, but I don’t know how to change it in’P2D Mode’.

Do you know anyone?

-Environment: Processing3.5.3  
-Mode: JAVA Mode

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [October 12, 2020, 4:44pm UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535/2 "2020-10-12T16:44:51Z")

</div>

I had a look in the [GLWindow API](https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/newt/opengl/GLWindow.html) but could not find anything about the window icon - sorry.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [October 13, 2020, 5:49am UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535/3 "2020-10-13T05:49:45Z")

</div>

There seems to be no solution.  
Thank you for answer.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [November 26, 2021, 4:58pm UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535/4 "2021-11-26T16:58:30Z")

</div>

Is this still unresolved?  
At this time, the conclusion I made at the time was 'The icon cannot be changed. ’ is.

Does anyone have any solution?

---

<div class="post-metadata">

**Author:** ![LangdonS](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@LangdonS](https://discourse.processing.org/u/LangdonS)\
**Post date:** [December 21, 2022, 1:58pm UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535/5 "2022-12-21T13:58:30Z")

</div>

This worked for me:  
getSurface().setIcon(loadImage(“icon.png”));

(You need a file named “Icon.png”)

---

<div class="post-metadata">

**Author:** ![LangdonS](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@LangdonS](https://discourse.processing.org/u/LangdonS)\
**Post date:** [December 21, 2022, 1:59pm UTC](https://discourse.processing.org/t/g4p-new-windows-how-to-change-the-icon-inp2d-mode/24535/6 "2022-12-21T13:59:46Z")

</div>

If anyone figures out how to use a vector image, I am looking for it.

(it looks pixelated and bad)
