public void processButton(int programButton) {
        if (programButton == 0 && currentThread.isAlive()) {
            currentThread.interrupt();
        }

        if (!currentThread.isAlive()) {
            switch (programButton)  {
                case 0:
                    currentThread = new WashingProgram0(machine, speed, temperatureController, waterController, spinController);
                    break;
                case 1:
                    currentThread = new WashingProgram1(machine, speed, temperatureController, waterController, spinController);
                    break;
                case 2:
                    currentThread = new WashingProgram2(machine, speed, temperatureController, waterController, spinController);
                    break;
                case 3:
                    currentThread = new WashingProgram3(machine, speed, temperatureController, waterController, spinController);
                    break;
            }

            currentThread.start();
        }
    }