wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes difference between semantic events and low-level events Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "difference between semantic events and low-level events" Watch "difference between semantic events and low-level events" New topic
Author

difference between semantic events and low-level events

leena rane
Ranch Hand

Joined: Aug 13, 2001
Posts: 280
I have not exactly understood the difference between semantic events and low-level events.Could someone explain in simple words ?
(I know which 4 are semantic)
Thanx in advance
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072

1)Semantic events
ActionEvent
AdjustmentEvent
ItemEvent
TextEvent
These classes are used for high level semantic events, to represent user interaction with a GUI component. For example , clicking a button, slecting a menu item , selecting a checkbox, scrolling and changing text in the text field or text area all result in indidual semantic events
2) Low level
ComponentEvent
ContainerEvent
FocusEvent
KeyEvent
MouseEvent
PaintEvent
WindowEvent
These classes are used to represent low level input or window operations.Several low level events can constitute a single semantic event. For example , clicking on a button is actually a sequence of mouse movements to position the cursor followed by pressing and releasing a mouse button.
http://www.amazon.com/exec/obidos/ASIN/0201596148/electricporkchop

hope this helps
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Low level events are those produced by the keyboard, mouse and those related to windows: KeyEvent, FocusEvent, MouseEvent, WindowEvent, ComponentEvent and ContainerEvent. Keyboard and mouse are regarded as low level input.
Sometimes a low level event spawned a semantic one. Such as a click of the mouse in a button produces ActionEvent; or an item has been selected in a Choice, or a window has been iconified.
While FocusEvent, KeyEvent, MouseEvent and ComponentEvent can ocurr in any Component; the semantics one, ItemEvent, TextEvent, AdjustmentEvent and ActionEvent are related with a particular type of component. Semantics events somehow have a meaning: TextEvent represents a change in the text of an TextComponent object. ItemEvent represents that an Item has been selected, this could be a Checkbox, a CheckboxMenuItem, or any item in a List or Choice. AdjustmentEvent means that the value hold by an object implementing Adjustable has changed. ActionEvent means that a Button was pressed, a List was double clicked, a TextField received Enter or a MenuItem was selected.
By listenning semantics events you are interested in what has happened (the meaning),not in the low events that ocurred.
Please correct or add anything


SCJP2. Please Indent your code using UBB Code
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Hey did you notice that the "meaning" of ActionEvent was not very clear?
Richard G. Baldwin wrote here
http://home.att.net/~baldwin.rg/Intermediate/Java080.htm
that the meaning is "do a command"
leena rane
Ranch Hand

Joined: Aug 13, 2001
Posts: 280
Thanx Ersin,
Thanx Jose
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Today I have discovered the following:
java.awt.event
java.awt.event.ComponentEvent low level events
but
java.awt.event
semantics events
All the low level events can obtain the Component on which they ocurred, and thus using all of its methods, via event.getComponent()
But with semantics you can't do that. I guess you are interested in the meaning of the event, not in the Component.
This is form the URL that I gave yesterday. Browse it, it's impresive.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between semantic events and low-level events
 
Similar Threads
MouseListener active for Disabled JLabel
Semantic Events
java.awt.Event Constructors
Why java is a middle level language.
Memorize Continer inheritance?