public void removePaintPageListener(PaintPageListener listener) {
        // remove a listener if it is already registered
        synchronized (paintPageListeners) {
            if (paintPageListeners.contains(listener)) {
                paintPageListeners.removeElement(listener);
            }

        }
    }