Q:

Is there an standard class for Events in Java?

I wrote a Listener. Now I want to notify it, when a change occurs. Nothing special. 
Now I'm asking myself: 
Is there I standard class for Events that I can use, or do I have to write a new one by myself?
I know there ara java.awt.Event and AWTEvent. But I am not working directly at GUI level here. Furthermore we are using Swing at GUI level. So I'm not shure if it is a good idea to mix Swing and AWT. 
Thx

A:

Its ancient and simple, but you could use Observer/Obserable in java.util:

java.util
public class Observable extends Object
This class represents an observable
  object, or "data" in the model-view
  paradigm. It can be subclassed to
  represent an object that the
  application wants to have observed.
An observable object can have one or
  more observers. An observer may be any
  object that implements interface
  Observer. After an observable instance
  changes, an application calling the
  Observable's notifyObservers method
  causes all of its observers to be
  notified of the change by a call to
  their update method.

For more info, try http://www.javaworld.com/javaworld/jw-10-1996/jw-10-howto.html.

