public void addControlLogic() {
        Action run = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                run();
            }
        };
        runButton.addActionListener(run);

        Action clear = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                clear();
            }
        };
        clearButton.addActionListener(clear);

        Action delete = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                delete();
            }
        };
        deleteButton.addActionListener(delete);

        commandCombo.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (autoRunCheckBox.isSelected() && autoRunEnabled) {
                    run();
                }
            }
        });
        enableDestinationCheckBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                destinationPanel.setEnabled(
                        enableDestinationCheckBox.isSelected());
            }
        });

        KeyAdapter adapter = new KeyAdapter() {
            public void keyReleased(KeyEvent e) {
                int code = e.getKeyCode();
                if (code == KeyEvent.VK_ENTER) {
                    if (!autoRunCheckBox.isSelected()) {
                        run();
                    }
                } else if (code == KeyEvent.VK_UP) {
                    autoRunEnabled = false;
                } else if (code == KeyEvent.VK_DOWN) {
                    autoRunEnabled = false;
                }
            }};
        
        Component editor = commandCombo.getEditor().getEditorComponent();
        editor.addKeyListener(adapter);
        sourcePanel.addEditorKeyListener(adapter);
        sourcePanel.addComboBoxActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (autoRunCheckBox.isSelected() && autoRunEnabled) {
                    run();
                }
            }
        });
    }