// implementation of java.awt.event.ActionListener interface public void actionPerformed(JCActionEvent e) { if (e.getSource() == ok || e.getSource() == cancel) { if (e.getSource() == ok) { accept = true; } else { accept = false; } dialog.dispose(); } else { JCButton b = (JCButton) e.getSource(); Color c = b.getBackground(); updateColor(c, e.getSource()); } }