JComponent preview = ok.getTransparancyAdjustment(initColor.getAlpha()); colorDialog.getContentPane().remove(jcc);  JPanel content = new JPanel(); GridBagLayout gridBag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); c.gridwidth = GridBagConstraints.REMAINDER; content.setLayout(gridBag); gridBag.setConstraints(jcc, c); gridBag.setConstraints(preview, c); content.add(jcc); content.add(preview);  colorDialog.getContentPane().add(content, BorderLayout.CENTER); colorDialog.pack();
    public static Color showDialog(Component component,                                   String title,                                    Color startingColor) {        Color initColor = startingColor != null ? startingColor : Color.white;        final JColorChooser jcc = new JColorChooser(initColor);        ColorTracker ok = new ColorTracker(jcc);        jcc.setPreviewPanel(ok.getTransparancyAdjustment(initColor.getAlpha()));        jcc.getSelectionModel().addChangeListener(ok);        JDialog colorDialog = JColorChooser.createDialog(component, title,                                                         true, jcc,                                                         ok, null);        colorDialog.show();        return ok.getColor();    }