Thread Wait and Wake up
===

I'm trying to simulate a simple thermostat, using multi-threading. The thermostat should increase the temperature in order to reach the value that the user requested for which is "Max" value in the code below. I have two thread, one in charge of increasing the temperature and the other for decreasing it. but the condition for decreasing is it should be only running when the gas is off. 
but I have a problem with implementing this concept. as the code below runs, the second thread keeps throwing exception of null!

    <pre><code>`private void formWindowActivated(java.awt.event.WindowEvent evt) {                                     
    systemInitial();

    Thread temperatureUp = new Thread() 
    {
        @Override
        public void run()
        {
        while(true)
        {
            Max = Integer.parseInt(lblDesiredTemp.getText());
            Current = Integer.parseInt(lblCurrentTemp.getText());

                try
                {
                    if(Max>Current)
                    {
                        lblGasStatus.setText("On");
                        lblTemperatureSensor.setText("increasing");
                        increaseTemeture();
                    }
                    else
                    {
                        lblGasStatus.setText("Off");
                        if(Current != 0)
                            lblTemperatureSensor.setText("decreasing");
                        else
                            lblTemperatureSensor.setText("----");
                    }
                }
                catch(Exception ex)
                {
                    txtLog.setText(ex.getMessage() + "\n" + txtLog.getText() );
                }
        }
        }
    };

    Thread systemUpdater = new Thread() 
    {
        @Override
        public void run()
        {
        while(true)
        {
            try
            {
                notifyGasBoiler(this);

                if(Current>0)
                    decreaseTemeture();
            }
            catch(Exception ex)
            {
                txtLog.setText(ex.getMessage() + "\n" + txtLog.getText() );
            }
        }
        }
    };

        temperatureUp.start();
        systemUpdater.start();

    }                                    

    private synchronized void notifyGasBoiler(Thread gasOff) throws InterruptedException 
    {
        try
        {
            if("On".equals(lblGasStatus.getText()))
            {
                gasOff.wait();
                txtLog.setText(txtLog.getText() + "\n" + gasOff.getName() + " waits.");
            }
            else
                notifyAll();
        }
        catch (Exception ex)
        {
            txtLog.setText(ex.getMessage() + "\n" + txtLog.getText() );
        }
    }`
</code></pre>

what am I missing here?