void (ActionEvent e) { RelativePoint location = new RelativePoint(this, new Point(getWidth() / 2, getHeight())); ColorListener listener = new ColorListener() { @Override public void colorChanged(Color color, Object source) { if (color != null) { myColor = color; } setSelected(myColor != null); CustomColorButton.this.revalidate(); CustomColorButton.this.repaint(); } }; ColorChooserService.getInstance().showPopup(null, myColor, listener, location); }