# G4P - Secondary Window Buttons Not Always Reliable

**URL:** <https://discourse.processing.org/t/g4p-secondary-window-buttons-not-always-reliable/44518>\
**Category:** Libraries\
**Created:** [May 31, 2024, 12:57pm UTC](https://discourse.processing.org/t/g4p-secondary-window-buttons-not-always-reliable/44518 "2024-05-31T12:57:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 2, 2024, 7:22pm UTC](https://discourse.processing.org/t/g4p-secondary-window-buttons-not-always-reliable/44518/4 "2024-06-02T19:22:16Z")

</div>

```auto
I have read that Processing doesn’t play well with the Swing library

```

That’s not a problem if you use a separate thread. It was discussed here:[https://discourse.processing.org/t/swing-components-in-default-processingwindow/35483](https://discourse.processing.org/t/swing-components-in-default-processingwindow/35483)

A few things have been learned since that original post. For example the default canvas can be used for conventional drawing calls using draw() if you reduce the size of it and use it like a normal control instead of removing it entirely (obviates use of JPanel for drawing). Swing components can also be used in Python with py5. I’m mentioning all of this not to persuade you to switch from G4P but to clear up the threading issue; Processing plays nicely with Swing if you use a separate thread. We’ve also been using it in py5 without the additional thread and so far no problems that we are aware of.

---

_[View the full topic](https://discourse.processing.org/t/g4p-secondary-window-buttons-not-always-reliable/44518)._
