amarillion
amarillion

Reputation: 24917

Pick recently selected colors in java

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

Answers (2)

Tiberiu
Tiberiu

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

Kathy Van Stone
Kathy Van Stone

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

Related Questions