# A possible bug of Processing (?) - cannot resize window by Java2D, but ok by P2D and P3D

**URL:** <https://discourse.processing.org/t/a-possible-bug-of-processing-cannot-resize-window-by-java2d-but-ok-by-p2d-and-p3d/43139>\
**Category:** Processing\
**Created:** [November 4, 2023, 2:06am UTC](https://discourse.processing.org/t/a-possible-bug-of-processing-cannot-resize-window-by-java2d-but-ok-by-p2d-and-p3d/43139 "2023-11-04T02:06:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_The\_Sun](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/martin_the_sun/32/17660_2.png) [@Martin\_The\_Sun](https://discourse.processing.org/u/Martin_The_Sun)\
**Post date:** [November 4, 2023, 2:06am UTC](https://discourse.processing.org/t/a-possible-bug-of-processing-cannot-resize-window-by-java2d-but-ok-by-p2d-and-p3d/43139/1 "2023-11-04T02:06:21Z")

</div>

My project allows the users to resize windows. It works fine before in my old PC with Win10 and Processing 4.1.1. Now I change my PC to a new one with Win 11, and with graphics card NVIDIA RTX A4000. I find that I cannot resize the window anymore. Every time I resize it, the window halted and the extra area in window becomes black color. The program even don’t run the draw() function. I am now using Processing 4.3. My JDK in this new PC was JDK8 and then I upgraded it to JDK11 and JDK21. I also update the driver of my graphic card to the latest. The problem still exists. It exists even I just used a very simple program (from Processing web site) to test. The code is here:

```auto
void setup() {
size(200, 200);
surface.setTitle("Hello World!");
surface.setResizable(true);
surface.setLocation(100, 100);
}
void draw() {
background(128);
line(0, 0, width, height);
line(width, 0, 0, height);
}

```

However, if I use P2D or P3D as the rendener in the above example, the window can resize and the problem does not exist anymore. Unfortunately I cannot change my project to use P2D or P3D because it involves too many changes. Can anyone tell me how to solve this issue? Or this is a bug in Processing?

Just add a bit more information. This is not the first time I encounter this problem. The problem may not simply related with Win11. I encountered this problem in PC of Win10 before but it just rarely happened on one or two PC, not commonly happened.
