if(currentProcess != null) currentProcess.destroy();
    public void actionPerformed(ActionEvent e) {        Object source = e.getSource();        // Run button starts a new command        if(this.currentProcess==null && (source == runStopButton)) {            inputField.setEnabled(false);            runCommand(inputField.getCommand());        }        // Stop button stops current process        else if(this.currentProcess!=null && source==runStopButton) {            processMonitor.stopMonitoring();            processInput.close();            currentProcess.destroy();            this.currentProcess = null;            switchToRunState();        }        // Cancel button disposes the dialog and kills the process        else if(source == cancelButton) {            dispose();			        }    }