Java JComponent Color createColorChooser(Component component)

Here you can find the source of createColorChooser(Component component)

Description

create Color Chooser

License

Open Source License

Declaration

public static JColorChooser createColorChooser(Component component) 

Method Source Code

//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
}

Related

  1. applyBackgroundToSubComponents(Container container, Color color)
  2. buildTextPane(String text, Color foreground)
  3. color(String string, AttributeSet set)
  4. convertHtmlColorNameToColor(String htmlColorName)
  5. createDisabledTextComponent (String text, Color color, boolean textField)
  6. createDisabledTextField (String text, Color color)
  7. createHorizontalLine(Color background)
  8. createLabel(final String label, final int alignment, final Color background, final Color foreground)