{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

14-GUIStatic - Interactive Programs CS/ENGRD 2110...

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

View Full Document Right Arrow Icon
6/15/2011 1 CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2011 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 Windows & components 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, ...
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern