List of usage examples for javax.swing JColorChooser setColor
public void setColor(int c)
From source file:Main.java
public static void main(String[] argv) { JColorChooser chooser = new JColorChooser(); // Set the selected color chooser.setColor(Color.red); // Get current selected color Color color = chooser.getColor(); }
From source file:freemind.controller.Controller.java
public static Color showCommonJColorChooserDialog(Component component, String title, Color initialColor) throws HeadlessException { final JColorChooser pane = getCommonJColorChooser(); pane.setColor(initialColor); ColorTracker ok = new ColorTracker(pane); JDialog dialog = JColorChooser.createDialog(component, title, true, pane, ok, null); dialog.addWindowListener(new Closer()); dialog.addComponentListener(new DisposeOnClose()); dialog.show(); // blocks until user brings dialog down... return ok.getColor(); }