Implementing a Constrained Property Constrained properties fire a PropertyChangeEvent whenever its value is about to be changed. Any listener can veto the event, thereby preventing the change. This example bean implements a single constrained integer property called ``property.'' int property; public int getProperty() { return property; } public void setProperty(int newValue) throws PropertyVetoException { try { vceListeners.fireVetoableChange( "property", new Integer(property), new Integer(newValue)); property = newValue; } catch (PropertyVetoException e) { throw e; } } // Create the listener list. VetoableChangeSupport vceListeners = new VetoableChangeSupport(this); // The listener list wrapper methods. public synchronized void addVetoableChangeListener( VetoableChangeListener listener) { vceListeners.addVetoableChangeListener( listener); } public synchronized void removeVetoableChangeListener( VetoableChangeListener listener) { vceListeners.removeVetoableChangeListener( listener); }