private void writeObject(ObjectOutputStream s) throws IOException {
        s.defaultWriteObject();

        for (PropertyChangeListener l : getPropertyChangeListeners()) {
            if (l instanceof Serializable) {
                s.writeObject(l);
            }
        }

        for (VetoableChangeListener l : getVetoableChangeListeners()) {
            if (l instanceof Serializable) {
                s.writeObject(l);
            }
        }

        s.writeObject(null);
    }