12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.

Slides:



Advertisements
Similar presentations
Chapter 8 Improving the User Interface
Advertisements

Graphic User Interfaces Layout Managers Event Handling.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 7 Improving the User Interface
10.1 AWT The AWT classes Users today expect a Graphical User Interface (GUI) Improves application usability Difficult to implement cross-platform.
Graphical User Interfaces A Quick Outlook. Interface Many methods to create and “interface” with the user 2 most common interface methods: – Console –
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington GUI and the UI API COMP.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Welcome to CIS 083 ! Events CIS 068.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington While loops and the UI API.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Event Driven Programming
1 Event Driven Programming wirh Graphical User Interfaces (GUIs) A Crash Course © Rick Mercer.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
C H A P T E R T E N Event-Driven Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Dale Roberts GUI Programming using Java - Event Handling Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
 2002 Prentice Hall, Inc. All rights reserved Introduction Graphical User Interface (GUI) –Gives program distinctive “look” and “feel” –Provides.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
Python Programming Graphical User Interfaces Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Computing Science 1P Lecture 17: Friday 23 rd February Simon Gay Department of Computing Science University of Glasgow 2006/07.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Timer class and inner classes. Processing timer events Timer is part of javax.swing helps manage activity over time Use it to set up a timer to generate.
Concurrent Programming and Threads Threads Blocking a User Interface.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
CS-1020 Dr. Mark L. Hornick 1 Event-Driven Programming.
CITA 342 Section 2 Visual Programming. Allows the use of visual expressions (such as graphics, drawings, or animation) in the process of programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Object Oriented Programming.  Interface  Event Handling.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Event-Driven Programming 1.
Agenda Introduction. Event Model. Creating GUI Application. Event Examples.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 – Graphical User Interfaces Java Foundations: Introduction to Programming.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
GUI Programming Joseph Sant Sheridan College. Agenda Elements of GUI programming Component-Based Programming. Event-Based Programming. A process using.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Event-driven Input COMP 102.
1 Event Driven Programs Rick Mercer. 2 So what happens next?  You can layout a real pretty GUI  You can click on buttons, enter text into a text field,
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Programming Logic and Design Seventh Edition Chapter 12 Event-Driven GUI Programming, Multithreading, and Animation.
GUI Programming using Java - Event Handling
Event Loops and GUI Intro2CS – weeks
Chapter Topics 15.1 Graphical User Interfaces
Event-driven programming
Event loops 16-Jun-18.
Processing Timer Events
Event Driven Programming Dick Steflik
Ellen Walker Hiram College
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Event Driven Programming
EE 422C Java FX.
Timer class and inner classes
Event loops.
Event Driven Programming
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Chapter 15: GUI Applications & Event-Driven Programming
Event loops 8-Apr-19.
HTML and CSS Basics.
Event loops.
ACM programming contest
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

12-Jun-16 Event loops

2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output Process

3 Very early interactive programs BASIC was an early interactive language Still a central computer, with terminals Style of interaction was “filling out forms” Process input Ask user for input Process input etc.

4 Command-driven programs (30 years ago) Allow the user to enter “commands” Much more flexible Still only a single source of inputs Not good enough for modern programs Ask user for command Read and parse command Execute command quit

5 Modern event-driven programs Multiple sources of input mouse clicks keyboard timers external events A new program structure is required Wait for event Dispatch event Quit

6 Java hides the event loop The event loop is built into Java GUIs GUI stands for Graphical User Interface Interacting with a GUI component (such as a button) causes an event to occur An Event is an object You create Listener s for interesting events Listener is an interface; you create a Listener by implementing that interface The Listener method gets the Event as a parameter

7 Building a GUI To build a GUI in Java, Create some Component s Use a layout manager to arrange the Component s in a window Add Listener s, usually one per Component Put methods in the Listener s to do whatever it is you want done That's it! Of course, there are a lot of details....

8 Vocabulary I Event – an object representing an external happening that can be observed by the program event-driven programming – A style of programming where the main thing the program does is respond to Events event loop – a loop that waits for an Event to occur, then dispatches it to the appropriate code GUI – a Graphical User Interface (user interacts with the program via things on the screen)

9 Vocabulary II Component – an interface element, such as a Button or a TextField Layout Manager – an object (provided by Java) that arranges your Components in a window Listener – an interface you implement to execute some code when an Event occurs

10 The End