What is the difference between an action and a event .?
is this the same ?
Dunno how it happened, but after editing my post it posted another message(see below). If any admin sees this, you may delete this post.
hmm i'm having a hard time to think up something that explains the difference...
The easiest i can come up with is:
The action is what the kind of action is that happened, the event contains information about who caused that action.
So the same action can be caused by different kinds of events and 1 event can cause multiple actions. (maybe the last part isn't totally correct?)
key example:
-keyPressed
-keyReleased
-keyTyped
These 3 Actions, that's what a key can do. When the action occurs, Java also gives an Event, in this case a KeyEvent. Which can tell you which key did it.
keypressed, can be caused by multiple keys. 1 key can be pressed, typed & released, multiple actions.So the same action can be caused by different kinds of events and 1 event can cause multiple actions.
ok ..~ understand now ..~ so when an action occurs , the event object will send an information that contains about the action to the action listener object ..~ thus , something will occur after the action ...~![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks