Example usage for javax.swing JColorChooser removeChooserPanel

List of usage examples for javax.swing JColorChooser removeChooserPanel

Introduction

In this page you can find the example usage for javax.swing JColorChooser removeChooserPanel.

Prototype

public AbstractColorChooserPanel removeChooserPanel(AbstractColorChooserPanel panel) 

Source Link

Document

Removes the Color Panel specified.

Usage

From source file:Main.java

public static void main(String[] argv) {
    JColorChooser chooser = new JColorChooser();
    AbstractColorChooserPanel[] oldPanels = chooser.getChooserPanels();
    for (int i = 0; i < oldPanels.length; i++) {
        String clsName = oldPanels[i].getClass().getName();
        if (clsName.equals("javax.swing.colorchooser.DefaultSwatchChooserPanel")) {
            chooser.removeChooserPanel(oldPanels[i]);
        } else if (clsName.equals("javax.swing.colorchooser.DefaultRGBChooserPanel")) {
            chooser.removeChooserPanel(oldPanels[i]);
        } else if (clsName.equals("javax.swing.colorchooser.DefaultHSBChooserPanel")) {
            chooser.removeChooserPanel(oldPanels[i]);
        }/*from   w w w.  j  ava  2s.c om*/
    }
}