# How to open multiple windows?

**URL:** <https://discourse.processing.org/t/how-to-open-multiple-windows/44271>\
**Category:** Coding Questions\
**Created:** [April 12, 2024, 1:21pm UTC](https://discourse.processing.org/t/how-to-open-multiple-windows/44271 "2024-04-12T13:21:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillyGrz](https://avatars.discourse-cdn.com/v4/letter/w/c77e96/32.png) [@WillyGrz](https://discourse.processing.org/u/WillyGrz)\
**Post date:** [April 12, 2024, 1:21pm UTC](https://discourse.processing.org/t/how-to-open-multiple-windows/44271/1 "2024-04-12T13:21:36Z")

</div>

When you’re messing around for fun or something, I’m able to make the window move or resize if I want to. Is there a way to open multiple windows with the same code?

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [April 12, 2024, 1:26pm UTC](https://discourse.processing.org/t/how-to-open-multiple-windows/44271/2 "2024-04-12T13:26:37Z")

</div>

There are several ways to do this; here’s one:

```auto
import javax.swing.*;

void setup() {
  size(800,800);
  surface.setTitle("Default Window");
  
  JFrame wnd1 = new JFrame("Window One");
  wnd1.setUndecorated(true);
  wnd1.setBounds(100,100,300,350);
  wnd1.setVisible(true); 
  
  JFrame wnd2 = new JFrame("Window Two");
  wnd2.setBounds(300,200,300,350);
  wnd2.setVisible(true); 
  
  JFrame wnd3 = new JFrame("Window Three");
  wnd3.setBounds(500,300,300,350);
  wnd3.setVisible(true); 
  
}

void draw(){
  // Use default canvas from default wnd if you need this for graphics
  fill(255,0,0);
  circle(width/2, height/2,300);
}

```

Can also use PApplets.

---

<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:** [April 14, 2024, 10:38am UTC](https://discourse.processing.org/t/how-to-open-multiple-windows/44271/3 "2024-04-14T10:38:55Z")

</div>

> [@WillyGrz](#):
>
> Is there a way to open multiple windows with the same code?

Do a search in the forum for _multiple windows_.  
You can decide which best suits your needs.

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/2/b2c4deafb3a7d88c28a35481ed4f9ec966313a16.png)

`:)`

---

<div class="post-metadata">

**Author:** ![tribblesontoast](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Post date:** [April 19, 2024, 1:06am UTC](https://discourse.processing.org/t/how-to-open-multiple-windows/44271/4 "2024-04-19T01:06:18Z")

</div>

I just discovered this myself earlier today. Serendipitous!

From the Processing IDE:  
File \> Examples \> Tests \> MultipleWindows

As svan said, this approach uses PApplets.
