Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Color chooser setColor not working in Java 7 #105

@pengfoong

Description

@pengfoong

In Java 7, with skin set, JColorChooser.setColor does not change the color selected in the chooser panels. This happens for all the chooser panels.

All the chooser panels will show the white color no matter what color is set. For example, the RGB slider will all be 255, 255 ,255. However, the bar next to the tool that let you pick color from anywhere from screen works. It changes color when setColor is called.

This happens in 7.1 and 7.2. My machine is a windows 7 x64 if it matters. The problem doesn't appear in Java 6.

Here is a sample application to replicate the problem. Also, the color chooser in the demo doesn't work. Most of the items are invisible. It works on Java 6 though.

public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); javax.swing.SwingUtilities.invokeLater(new Runnable() { @Override public void run() { SubstanceLookAndFeel.setSkin(new OfficeBlue2007Skin()); JColorChooser chooser = new JColorChooser(); chooser.setColor(Color.yellow); JDialog dialog = JColorChooser.createDialog(null, "title", true, chooser, null, null); dialog.setVisible(true); } }); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions