Code example for PropertyChangeListener

Methods: propertyChange

0
      swingDispatcherFactory.create(PropertyChangeListener.class, listener);
 
    final PropertyChangeEvent event =
      new PropertyChangeEvent(this, "my property", "before", "after");
 
    swingDispatchedListener.propertyChange(event);
 
    // Wait for a dummy event to be processed by the swing event 
    // queue. 
    SwingUtilities.invokeAndWait(m_voidRunnable);
 
    assertEquals(event, listener.getLastEvent());
    errorHandlerStubFactory.assertNoMoreCalls();
 
    final RuntimeException e = new RuntimeException("Problem");
    listener.setThrowException(e);
 
    swingDispatchedListener.propertyChange(event);
    SwingUtilities.invokeAndWait(m_voidRunnable);
 
    assertNull(listener.getLastEvent());
 
    errorHandlerStubFactory.assertSuccess("handleException", e);