How do I wrap propertyChanged code into an event dispatch thread?

/*

* EventRunnableHandler.java

*

* Created on March 14, 2007, 3:36 PM

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/

package com.ppowell.tools.ObjectTools.SwingTools;

import java.util.EventObject;

/**

* Wrapper for Runnable interface that will allow for {@link java.util.EventObject}

* @author Phil Powell

* @version JDK 1.6.0

*/

publicclass EventRunnableHandlerimplements Runnable{

/**

* {@link java.util.EventObject}

*/

private EventObject evt;

/**

* Creates a new instance of EventRunnableHandler

* @param evt {@link java.util.EventObject}

*/

public EventRunnableHandler(EventObject evt){

this.evt = evt;

}

/** Perform run */

publicvoid run(){}

}

/**

* Invoked when task's progress property changes.

*/

publicvoid propertyChange(PropertyChangeEvent evt){

SwingUtilities.invokeLater(new EventRunnableHandler(evt){

publicvoid run(){

if (evt.getPropertyName() =="progress"){

int progress = (Integer)evt.getNewValue();

progressBar.setValue(progress);

}

}

});

}

This code fails to compile producing the error message:

local variable evt is accessed from within innerclass; needs to be declaredfinal

Bluntly put, how do I fix this?

Thanx

Phil

[2688 byte] By [ppowell777a] at [2007-11-26 21:38:27]
# 1
public void propertyChange(final PropertyChangeEvent evt)
dmbdmba at 2007-7-10 3:21:26 > top of Java-index,Java Essentials,New To Java...
# 2
Crosspost: http://forum.java.sun.com/thread.jspa?threadID=5148309&tstart=0
KelVarnsona at 2007-7-10 3:21:26 > top of Java-index,Java Essentials,New To Java...