Lecture17 - Graphical User Interfaces(Input • Events and...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Graphical User Interfaces (Input) • Events and Listeners • Buttons • Text Fields • Reading for this lecture: L&L 4.5-4.8 • Review for Exam 2 Graphical User Interfaces • A Graphical User Interface (GUI) in Java is created with at least three kinds of objects: – components – events – listeners • We've previously discussed components , which are objects that represent screen elements – labels, buttons, text fields, menus, etc. • Some components are containers that hold and organize other components – frames, panels, applets, dialog boxes Events • An event is an object that represents some activity to which we may want to respond • For example, we may want our program to perform some action when the following occurs: – the mouse is moved – the mouse is dragged – a mouse button is clicked – a graphical button is clicked – a keyboard key is pressed – a timer expires • Events often correspond to user actions, but not always Events and Listeners • The Java standard class library contains several classes that represent typical events • Components, such as a graphical button, generate (or fire) an event when it occurs • A listener object "waits" for an event to occur and responds accordingly...
View Full Document

This note was uploaded on 09/25/2010 for the course CS 110 taught by Professor Wilson during the Spring '10 term at University of Massachusetts Boston.

Page1 / 14

Lecture17 - Graphical User Interfaces(Input • Events and...

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

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