Thanks Greg for the reply. But I think I was looking for a different answer.
I was trying to understand the meaning of an event.
I got the definition of an event as:
Events are objects or messages used when a software components wants to notify a state change to other components.
As per my understanding the classification can be of 3 types.
1. System generated GUI events (All the events which inherit from java.awt.AWTEvent class as of JDK1.1
2. System generated non-gui events. I am really not sure how this is possible or don't have an example for this. But from the design perspective this shud be possible.
Let me guess something like a task manager.
3. User generated events. This can be a Event Source implementing observer design pattern in which event handlers can register with the event source for notification.
If this classification is correct, then do we follow any standards for all the three categories of events.
I mean all exceptions have a common root, all threads have a common root, all objects have a common root. So why not a common root for all kinds of events ?
There should be a standard mechanism for creation as well as firing of events.
Secondly, if system generated GUI events r something which should have been generated only by System, then why do we have public constructors for all such events. :roll:
I was again thinking over the difference between creating an instance of event
and firing of an event
What can a user do by creating an instance of a system event, if he cannot fire it ?
or is there any way to fire the event.
Thanks in advance,