Java JComponent Color fixOsxColorChooser(JColorChooser chooser)

Here you can find the source of fixOsxColorChooser(JColorChooser chooser)

Description

fix Osx Color Chooser

License

LGPL

Declaration

public static void fixOsxColorChooser(JColorChooser chooser) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.awt.Component;

import javax.swing.JColorChooser;

import javax.swing.JComponent;

import javax.swing.JPanel;

import javax.swing.UIManager;

import javax.swing.colorchooser.AbstractColorChooserPanel;

public class Main {
    public static void fixOsxColorChooser(JColorChooser chooser) {

        if (!UIManager.getLookAndFeel().getName().equals("Mac OS X"))
            return;

        AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
        for (JPanel p : panels) {
            if (p != null) {
                p.setOpaque(false);/*from w w  w.j  av  a2 s .  co m*/
                ((JComponent) p.getParent()).setOpaque(false);
                for (Component c : p.getComponents()) {
                    ((JComponent) c).setBorder(null);
                    ((JComponent) c).setOpaque(false);
                }
            }
        }
    }
}

Related

  1. createHorizontalLine(Color background)
  2. createLabel(final String label, final int alignment, final Color background, final Color foreground)
  3. createLabel(JComponent parent, String text, Color color)
  4. createTextArea(String str, Color color)
  5. findPanel(JColorChooser chooser, String name)
  6. flashMessage(final Window parent, String string, Color background, Color foreground, final long howLong)
  7. highlightForDebugging(JComponent component, Color color)
  8. installColors(Component c, Color background, Color foreground)
  9. makeEmptyIcon(Dimension size, Color color)