java custom event on event dispatch thread

I am building a java application and i have implemented custom listeners and events. The problem now is that there are many events and listeners and the application GUI thread is being blocked while the listeners process the events. Can this be solved using event dispatch thread? If so how?

The code for listeners:

public class ProjectChangeObserver
{
    private List<ProjectChangeListener> listeners = new ArrayList<ProjectChangeListener>();

    public void addProjectChangeListener(ProjectChangeListener l)
    {
        listeners.add(l);
    }

    public void removeProjectChangeListener(ProjectChangeListener l)
    {
        listeners.remove(l);
    }

    public void removeAllProjectChangeListeners()
    {
       listeners.clear();
    }

    public void fireProjectChange(ProjectChangeEvent e)
    {
      if(listeners.size() > 0)
       { 
          ArrayList<ProjectChangeListener> safeCopy = new ArrayList<ProjectChangeListener>(listeners);
          for (ProjectChangeListener cl : safeCopy ) {
              cl.onProjectChange(e);
        }
       } 
     }
}
Answer:1

Quite to the contrary, this must be solved avoiding the Event Dispatch Thread ("GUI thread" is just another name for the same thing). You must use SwingWorker to start an asynchronous task in its own thread.

Answer:2

I've just learned java but from my old experience coming from C++ i tought that i can write a commandline calculator wich supports all 4 basic operators with just one line. But i am having a bit of ...

I am developing a small application in Java. I am using Java2D Library for drawing some graphical objects. Now i want to draw some semi-circle like shape or in simple words i need to draw this ( shape ...

I can't figure out why the output is different. The output is same only in the range -128 to 127. public class Check { public static void main(String[ ] args) { Integer i1=122; ...

When I was doing JSP/Servlet programming, whenever I dropped 3rd party libraries into the WEB-INF/lib folder, they were automatically included in the project classpath. In GWT, this is not the case. ...