14-GUIStatic - 3/15/2011 Interactive Programs CS/ENGRD 2110...

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

View Full Document Right Arrow Icon
1 CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2010 Thorsten Joachims Lecture 14: Graphical User Interfaces (Static) Interactive Programs “Classic” view of computer programs: transform inputs to outputs, stop Event-driven programs: interactive, long-running Servers interact with clients Applications interact with user(s) 2 user user program input events output events input output GUI Motivation Interacting with a Program Program-Driven = Proactive Statements execute in sequential, predetermined order Typically use keyboard or file I/O, but program determines when that happens Usually single-threaded Event-Driven = Reactive Program waits for user input to activate certain statements Typically uses a GUI (Graphical User Interface) Often multi-threaded Design. ..Which to pick? Program called by another program? Program used at command line? Program interacts often with user? Program used in window environment? 3 Java Support for Building GUIs Java Foundation Classes Classes for building GUIs Major components awt and swing Pluggable look-and-feel support Accessibility API Java 2D API Drag-and-drop Support Internationalization Our main focus: Swing Building blocks of GUIs User interactions Built upon the AWT (Abstract Window Toolkit) Java event model 4 Java Foundation Classes Pluggable Look-and-Feel Support Controls look-and-feel for particular windowing environment E.g., Java, Windows, Mac Accessibility API Supports assistive technologies such as screen readers and Braille Java 2D Drawing Includes rectangles, lines, circles, images, . .. Drag-and-drop Support for drag and drop between Java application and a native application Internationalization Support for other languages 5 GUI Statics and GUI Dynamics Statics: what’s drawn on the screen Components E.g. buttons, labels, lists, sliders, menus, . .. Containers components that contain other components E.g. frames, panels, dialog boxes, . .. Layout managers control placement and sizing of components Dynamics: user interactions Events E.g. button-press, mouse- click, key-press, . .. Listeners an object that responds to an event Helper classes E.g. Graphics, Color, Font, FontMetrics, Dimension, . .. 6
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.

This note was uploaded on 09/17/2011 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell University (Engineering School).

Page1 / 4

14-GUIStatic - 3/15/2011 Interactive Programs CS/ENGRD 2110...

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