Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JColorChooser;
import javax.swing.colorchooser.AbstractColorChooserPanel;

public class Main {
    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]);
            }
        }
    }
}