Color Chooser?

Post Reply
borkman
Posts: 55
Joined: Tue May 09, 2023 7:26 pm

Color Chooser?

Post by borkman »

I'd like to allow users to customize certain colors on an upcoming module. I tried using JColorChooser but I get a HeadlessException so using Swing directly seems like a dead end. The VM API has file and message dialogs, but I couldn't find either a color chooser or a way to open a custom dialog. I could use another paradigm like choosing from a list of canned colors or setting RGB or something, but those approaches each have their own limitations, at least the way I'm envisioning them. Is there anyone who has implemented a flexible color chooser and wouldn't mind sharing their approach?
UrbanCyborg
Posts: 625
Joined: Mon Nov 15, 2021 9:23 pm

Re: Color Chooser?

Post by UrbanCyborg »

I hear the crickets chirping....from which I'd guess no one's done it. Just one of the things I've asked CA for in VMD. Mainly, I asked for better dialogs capabilities, because the MessageBox() functionality that's there is really strained doing the help system on my modules. This one would be nice, too.

Reid
Cyberwerks Heavy Industries -- viewforum.php?f=76
ColinP
Posts: 1000
Joined: Mon Aug 03, 2020 7:46 pm

Re: Color Chooser?

Post by ColinP »

I've had similar problems. The API doesn't provide any of the hooks required to do generalized dialog programming so you are left with only a few options such as...

1) A fixed menu of color names.
2) Creating a "pretend dialog" that is confined to the area of your module.
3) Having a separate little utility module dedicated to color choice that users can opt to launch temporarily when they want to change something.
borkman
Posts: 55
Joined: Tue May 09, 2023 7:26 pm

Re: Color Chooser?

Post by borkman »

Bummer. Ah well, onward and upward!
Post Reply

Return to “Module Designer”