# G4P java Concurrent Modification Exception Error when exit() called

**URL:** <https://discourse.processing.org/t/g4p-java-concurrent-modification-exception-error-when-exit-called/44532>\
**Category:** Libraries\
**Created:** [June 4, 2024, 1:17am UTC](https://discourse.processing.org/t/g4p-java-concurrent-modification-exception-error-when-exit-called/44532 "2024-06-04T01:17:13Z")\
**Posts on this page:** 1\
**Showing post:** 14

<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:** [June 5, 2024, 4:50pm UTC](https://discourse.processing.org/t/g4p-java-concurrent-modification-exception-error-when-exit-called/44532/14 "2024-06-05T16:50:50Z")

</div>

> [@Thundercat](#):
>
> I’m probably going about all this totally wrong aren’t I…

I believe so… 😄

> [@Thundercat](#):
>
> Because I’m trying to show different icons for one dialog box depending on state.

If by **dialog box** you mean the dialog boxes created with the `G4P.showMessage` method or one of the `G4P.select???`methods then they use either Swing or OS dialog boxes and this has been covered in this [discussion](https://discourse.processing.org/t/g4p-dialog-box-question/44488/1) so I have nothing to add.  
If on the other hand you are talking about your own dialog boxes created with GWindow then which icons are you talking about?

> [@Thundercat](#):
>
> Additionally, I’d like to be able to change the event handler on show/hide of visibility.

Which event handler are you talking about? Why do you need a different event handler when the window is invisible? Doesn’t make sense to me.

---

_[View the full topic](https://discourse.processing.org/t/g4p-java-concurrent-modification-exception-error-when-exit-called/44532)._
