Code example for PropertyChangeSupport

Methods: addPropertyChangeListenerfireIndexedPropertyChange

    public void testFireIndexedPropertyChange() { 
        final Object src = new Object();
        PropertyChangeSupport pcs = new PropertyChangeSupport(src);
        pcs.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                assertEquals(src, evt.getSource());
                assertEquals(0, ((IndexedPropertyChangeEvent)evt).getIndex());
                assertEquals("one", evt.getOldValue());
                assertEquals("two", evt.getNewValue());
        pcs.fireIndexedPropertyChange("foo", 0, "one", "two");
     * Test the method firePropertyChange(String, Object, Object) with normal 
     * parameters, when there is no listeners. 
Connect your IDE to all the code out there  Get Codota for Java