GUIevents - GUI Event Handling A hardward event like a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
GUI Event Handling A hardward event like a mouse click is trapped by the Windows O/S and posted to the JVM process if the cursor is in the JVM window. The JVM has an event queue which is processed by a single JVM Event Handler thread. In processing the mouse-click event, the JVM asks the same question that the Windows O/S did: "Where was the cursor?". If the cursor was in a background area, then it's a mouse click. But if the cursor was in an area where the JVM had drawn a picture of a button, then it's a button push! And, since it was the JVM graphics support that drew the picture of the button as a result of call to an add(button) method, the JVM can identify the button object that has been pushed, and the JVM Event Handler thread calls the button object on its processEvent() method. The button object does a "blink" as a human-factors feedback to the operator to indicate that it knows it has been pushed! (so the operator will not be tempted to push it again, which would cause another
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

GUIevents - GUI Event Handling A hardward event like a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online