private void updateHexField() {
        this.adjustingHexField++;
        try {
            int r = this.red.getIntValue();
            int g = this.green.getIntValue();
            int b = this.blue.getIntValue();

            int i = (r << 16) + (g << 8) + b;
            String s = Integer.toHexString(i).toUpperCase();
            while (s.length() < 6) {
                s = "0" + s;
            }
            if (this.hexField.getText().equalsIgnoreCase(s) == false) {
                this.hexField.setText(s);
            }
        } finally {
            this.adjustingHexField--;
        }
    }