@Override
    public void actionPerformed(ActionEvent actionEvent) {
        Object src = actionEvent.getSource();
        for (JButton bt : colorButtons) {
            if (src == bt) {
                currentColorButton.setText(bt.getText());
                currentColorButton.setForeground(bt.getForeground());
                return;
            }
        }
        for (JButton bt : buttons) {
            if (src == bt) {
                bt.setText(currentColorButton.getText());
                bt.setForeground(currentColorButton.getForeground());
                return;
            }
        }
        if (src == ok) {
            if (cubeBehavior != null) {
                Command command = new Command(CommandType.COLOR, makeColorString());
                //cubeBehavior.stop();
                cubeBehavior.addCommand(command);
                //cubeBehavior.start();
            }
            setVisible(false);
        } else if (src == cancel) {
            setVisible(false);
        }        
    }