Alternative: inheritance + interface implementation in one go private class ColorButton extends JButton implements ActionListener { private Color c; public ColorButton(Color c1, String name) { super(name); c = c1; addActionListener(this); //  OURSELVES !!.
{}