G4P Dialog Box Question

Hi Peter, I was wondering if it is possible to change the icons in the G4P dialog boxes?

I’d like to use my own instead of the default ones. Here’s what the example shows:

Screenshot 2024-05-26 at 7.43.57 AM

What if I want to use an “I” in a circle or something else? I didn’t see any place where the images are defined.

Sorry if this is an obvious question.

Thank you,


1 Like

G4P dialog boxes are wrapper functions to use either

  1. OS specific dialog boxes or
  2. Java Swing dialog boxes

so there are no methods available to customise them in G4P. I suggest that you try the axample sketch that comes with the library to see what options are available.

1 Like

Thank you Peter. I did try them, and there was nothing to be found to edit or change the icons. It sounds like the library does not support alternate icons.

Can we make this a feature request? Should I go to soundForge and post it?

As nice as the dialog boxes are, they need to be customizable in terms of the icons, or they really don’t work for any kind of development (they scream “generic”) even though they are highly functional.

Otherwise, I have already cobbled together a working system using additional windows, but it’s not as nice as being able to use your purpose-built dialog boxes. My dialog boxes work well, but it would be nice for icon cusmomization to be just part of the library. Just as you allow to customize the text, the icons should be customizable.

Thanks for your consideration, and again, I have to say THANK YOU for making this amazing tool! I’m probably pushing it beyond where most ever will, but I love it!


PS, your library sits in a very interesting space. On the one hand, you developed it for Processing, which means you’re going to attract inexperienced developers and newbies to coding. And you have provided so much for this category (into which I fall).

On the other hand some things that an innocent newbie would want to do are not available, and short of becoming a full blown java developer, the library is not really customizable.

Your experienced programmers aren’t going to use Processing. Pretty much at all, except maybe for playing around, even though it’s powerful.

So it’s a funny category for you to support overall. And of course you can’t think of everything and you can’t support every request “just because.” And I’m certain many times you’ve regretted making it too, thinking, “they just need to learn to program!”

Anyway thank you. You’ve done an amazing job. :slight_smile:

So this is what I came up with. But I’m not doing it the “right” way. Yet it works well and responds to mouse and key events:

Screenshot 2024-05-27 at 8.20.29 AM

Screenshot 2024-05-27 at 8.20.09 AM

And I even got an animated label to show a spinning ball for loading data:

Screenshot 2024-05-27 at 8.23.02 AM

Thank you again, I hope I didn’t come across ungrateful; I’m so grateful for your amazing library and the incredible, over the top (OTT) level of support you provide!!!


I think you missed the point from my previous post.

  • Java Swing provides dialog boxes,
  • Windows and osx also provide OS specific dialog boxes

on the other hand

  • Processing does not create dialog boxes
  • G4P does not create dialog boxes.

Processing and G4P both use the dialog boxes provided by Swing or the OS so the only customisation available is that provided by Swing or the OS so I can’t make this a feature of G4P.

A little bit of history / timeline here

  • 23rd March 2009 - the first release of G4P
  • 4th January 2013 - G4P included dialogs boxes

So for almost 4 years G4P did not include dialog boxes because Processing already had that area covered. So you might wonder why I bothered including them. :thinking:

About that time Processing V2 was released and they changed their dialog box implementation from synchronous to asynchronous. It meant that all sketches created in Processing V1 that used dialog boxes no longer worked as expected, if at all in V2.

Now converting a V1 sketch that used dialog boxes to work in V2 was not a trivial exercise and I suspected well beyond the capabilities of many Processing users. Modal dialog boxes (synchronous) are much simpler to understand and use so I decided to implement them in G4P making it easier to upgrade V1 sketches. This is the only reason they were included in G4P.

True but without G4P and other third-party libraries there will be even more things unavailable to the newbie.

Definitely not an area for newbies but you don’t have to be a full-blown Java developer either. Controls can be customized through extending existing controls and I have helped non-developers do so in the past.

Partly true - experienced programmers like myself do not use the Processing development environment preferring others such a Eclipse, Netbeans, VS, IntelliJ etc.

A little confession here. When I was introduced to Processing back in November 2008 I saw the potential for creating educational applets for the web (of course applets are dead now being replaced by Javascript).
The first thing I needed were simple GUI controls to provide interactivity so I created G4P, primarily for my personal use. At the time I didn’t realise there was already a well established GUI library controlP5, if I had would G4P exist? :grin:


Hi Peter, thank you for taking the time to explain! I certainly didn’t mean to cause you stress or make you feel you needed to defend yourself. The way I expressed myself did come across a little harshly - apologies! I didn’t mean it that way! I meant it more like, “this thing is SO AMAZING it “should” do xyz!”

Your library is fantastic!

I totally understand where you are coming from, and I accept what you are saying. It seems my implementation will turn out to be the way to go for my project, given that I can customize the dialogs as I wish.

And without your library, I would be becoming a full blown java developer - and this project would be delayed by a year or two! And as much as I love learning, trying to learn an entire language at warp speed is stressful. Now the stress is just spread over time as I learn the vagaries of Processing with java.

I think when my app is done it will be a good use case for your library anyway, and I’ll be glad to give screenshots to you if you wish to show some things it’s capable of. That sounds arrogant - I don’t mean it that way - I just mean, I wonder if anyone has tried to make an entire commercial app with it? And in my case by “commercial” I simply mean an app to support products I make and sell.

In any case, please know I deeply appreciate you, your time, and your amazing gift of the library. Yes I hear that you started it for your own use, and then made it available to others, so thank you for that as well!

All my best, and again, THANK YOU!!!


1 Like

Thanks for your concern but

  • you didn’t stress me out
  • I didn’t feel the need to defend myself
  • you did not come over harshly

Very occasionally I get the ‘entitled’ user who expects me to drop everything to solve their problem or make changes to a library. I have various strategies for dealing with them. :smiling_imp: