(8) Java GUIs

(8) Java GUIs - Reading CMSC 132 Object-Oriented...

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

View Full Document Right Arrow Icon
1 CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Reading Read Appendix C in the Koffman text (both editions) 2 3 Graphical user interfaces (GUIs) A GUI is often is the interface between a user and a program Can handle both input and output Affects the usability of a program User interfaces have improved as hardware has evolved Switches and light bulbs Punch cards and teletype (typewriter) Keyboard and black and white monitor (text) Mouse and color monitor (graphics) 4 Model-View-Controller (MVC) This is a model for GUI programming (Xerox PARC ’78) Separates a GUI into 3 components 1. Model application data 2. View visual interface 3. Controller user interaction Model View Controller
Background image of page 1

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

View Full Document Right Arrow Icon
5 MVC model of GUI design Model Should perform the actual work of the program that the GUI is for Should be independent of the GUI, but can provide access methods Controller Lets the user control what work the program is doing The design of the controller depends on the model View Lets the user see what the program is doing Should not display what the controller thinks is happening- base the display on the model, not the controller 6 Programming models Normal (control-flow based) programming model: Start running a program at main() Continue until main() finishes, or System.exit() is called Event-driven programming model: An event is an action or condition occurring outside
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

(8) Java GUIs - Reading CMSC 132 Object-Oriented...

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

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