Here you can find the source of createColorChooser(Component component)
public static JColorChooser createColorChooser(Component component)
//package com.java2s; // modify it under the terms of the GNU General Public License import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.JColorChooser; import javax.swing.JPanel; public class Main { public static JColorChooser createColorChooser(Component component) { // Method Instances. JColorChooser colorChooser; // Create color chooser. colorChooser = new JColorChooser(); colorChooser.setBorder(BorderFactory.createTitledBorder("Color")); colorChooser.setColor(component.getBackground()); colorChooser.setPreviewPanel(new JPanel()); return colorChooser; }//w w w. j ava2 s . c om }