Color Chooser?
Color Chooser?
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?
-
- Posts: 625
- Joined: Mon Nov 15, 2021 9:23 pm
Re: Color Chooser?
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
Reid
Cyberwerks Heavy Industries -- viewforum.php?f=76
Re: Color Chooser?
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.
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.
Re: Color Chooser?
Bummer. Ah well, onward and upward!