Is there a library that has the Windows color picker you see in ms paint and the desktop wallpaper setting dialog and elsewhere? The tiny file dialogs that comes with lwjgl3 (lightweight java game library) doesn't support getting or setting the user defined colors. I've tried using the Windows forms one with jni4net, but can't get the example to run. Here's the Stackoverflow question for that: https://stackoverflow.com/questions/57083930/jni4net-example-in-visual-studio-community-2019-fails-to-build-despite-targeting It needs to be able to get and set the user defined colors.
3 Answers
MS Paint and similar are probably using the common dialog controls that Microsoft provides.
Probably won't be able to use the Windows one, but GTK, Qt, and WxWidgets all have some level of support or wrapper to be used from Java, and one or more of them should have a color picker dialog available.
Since it about Java, what about JColorChooser?
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review Commented Dec 30, 2021 at 22:28
-
He asked about color picker and JColorChooser could be a solution.– convertCommented Dec 31, 2021 at 12:02
A time ago I developed the small library UiBooster. With it you can create a picker very easy. It is not the Paint color picker, but similar.
Color selectedColor = new UiBooster().showColorPicker("Choose your favorite color", "Color picking");