Reputation: 24917
I would like to add a color picker dialog to my app that remembers recently selected colors, so that it's easy to pick the exact same color as before, instead of getting several slight variations of a color.
I've tried but I couldn't do this with the standarard JColorChooser. JColorChooser has a recent-color panel in some look&feels (motif), but not in others (gtk). Also, there doesn't seem to be a way to prepopulate the set of recent colors, so there is no way to remember state.
What I would really like is an open source library with a better swing-based color picker solution. It has to be compatible with Java 5.
Upvotes: 5
Views: 943
Reputation: 548
Take a look at this question. It should solve your problem on one operating system but probably it will break the L&F for multiple platforms.
Upvotes: 0
Reputation: 26271
Have you tried looking at the Tutorial's section "Creating a Custom Chooser Panel"? It looks like to can create a custom panel of saved selections either as a new panel or as part of other panels.
Upvotes: 1