jcolorchooser

Java Swing issue - Using color palette

北城余情 提交于 2019-11-27 15:51:17
I have a problem here - I have a hexadecimal value being stored in a textfield after I have selected a color (using JColorChooser). What I would like to do is display the name of the color in another textfield right beside the one with the hexadecimal value, but I am unsure as to how to get the color name? I am including my code, maybe someone can give me some useful hints: public class Main extends JComponent implements Accessible { public ColorSelectionModel selectionModel; public static final String SELECTION_MODEL_PROPERTY = "selectionModel"; public JColorChooser chooser; public Color

Java Swing issue - Using color palette

我的梦境 提交于 2019-11-26 17:19:57
问题 I have a problem here - I have a hexadecimal value being stored in a textfield after I have selected a color (using JColorChooser). What I would like to do is display the name of the color in another textfield right beside the one with the hexadecimal value, but I am unsure as to how to get the color name? I am including my code, maybe someone can give me some useful hints: public class Main extends JComponent implements Accessible { public ColorSelectionModel selectionModel; public static