private void updateSlider() {
        this.adjustingSlider++;
        try {
            int mode = getMode();
            if (mode == HUE) {
                this.slider.setValue(this.hue.getIntValue());
            } else if (mode == SAT) {
                this.slider.setValue(this.sat.getIntValue());
            } else if (mode == BRI) {
                this.slider.setValue(this.bri.getIntValue());
            } else if (mode == RED) {
                this.slider.setValue(this.red.getIntValue());
            } else if (mode == GREEN) {
                this.slider.setValue(this.green.getIntValue());
            } else if (mode == BLUE) {
                this.slider.setValue(this.blue.getIntValue());
            }
        } finally {
            this.adjustingSlider--;
        }
        this.slider.repaint();
    }