Lecture 18 More on GUIs and Graphics Selected examples from Chapters 12, 13, 14, 15 Please read details in the book No need to memorize any of these details!!!

Slides:



Advertisements
Similar presentations
Review Text Material Covered –Culwin: Chapter 8 threads –Johnson: Chapters 9, 10, 1 through p.44 –Swing: Chapter 1-15 Lessons Learned –Concepts of concurrency/synchronization.
Advertisements

Lecture 3 A First Graphic Program. Features of a simple graphic program.
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
Fall 2007CS 225 Graphical User Interfaces Event Handling Appendix C.
C HAPTER 12 A Very Graphic Story. O VERVIEW Simple GUI Getting User Input Creating a Listener ActionEvents Displaying Graphics Drawing Multiple Buttons.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 16 JavaFX UI Controls and Multimedia.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Graphics Programming With Applets Feb 23, Applets There are three different types of executable java code. –Standalone application, which has main()
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 16 Creating User Interfaces.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 14 Graphics.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 13 Graphics.
Graphics Programming. In this class, we will cover: The difference between AWT and Swing Creating a frame Frame positioning Displaying information in.
Lecture 15 Graphical User Interfaces (GUI’s). Objectives Provide a general set of concepts for GUI’s Layout manager GUI components GUI Design Guidelines.
Slides prepared by Rose Williams, Binghamton University Chapter 19 Swing II.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L01 (Chapter 13) Graphics.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 15 Creating User.
Lecture 20 Programming with float and double Need for understanding how accurate these variables are.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L03 (Chapter 15) Creating.
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 16 : Swing VI Graphics King Fahd University of Petroleum & Minerals College of Computer.
CS 112 GUI 06 May 2008 Bilkent. Java GUI API Containers: ◦ contain other GUI components. E.g, Window, Panel, Applet, Frame Dialog. Components: ◦ Buttons,
Lecture 18 Review the difference between abstract classes and interfaces The Cloneable interface Shallow and deep copies The ActionListener interface,
CS 241 – Computer Programming II Lab Kalpa Gunaratna –
Web Design & Development Lecture 18. Java Graphics.
ACM/JETT Workshop - August 4-5, ExceptionHandling and User Interfaces (Event Delegation, Inner classes) using Swing.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 13 Creating User.
CIS 068 Welcome to CIS 083 ! Introduction to GUIs: JAVA Swing.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
Graphical User Interface Components Chapter What You Will Learn Text Areas Text Areas Sliders Sliders Menus Menus –With frames –Pop up menus Look.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved COS240 Object-Oriented Languages.
CMSC 202 Swing. Fall Introduction to Swing Swing is a Java package used to create GUIs The Java AWT (Abstract Window Toolkit) package is the original.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
Field Trip #19 Animations with Java By Keith Lynn.
– Advanced Programming P ROGRAMMING IN Lecture 21 Introduction to Swing.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
ITEC 109 Lecture 27 GUI. GUIs Review Sounds –Arrays hold sample values –Creating a keyboard –Sound effects Homework 3 –The big two –Due after break –Lab.
Agenda Java Coordinate Systems. Graphics Class. Drawing on Panels. Drawing Shapes.
Java Programming Working with Sound and Images. Topics Learn about the paint() and repaint() methods Learn about paintComponent() method Use the drawString()
CS 4244: Internet Programming User Interface Programming in Java 1.0.
1 GUIs, Layout, Drawing Rick Mercer. 2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces (GUIs)
Graphics basic 1. 2 Objectives Understand Java coordinate systems. Draw things using the methods in the Graphics class. Override the paintComponent method.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Java Dynamic Graphics.
Lab 7: BoxCar Class. Drawing a BoxCar Step 1:Create classes for Circle & Rectangle (done!) Step 2:Create a BoxCarPart class that can draw this part at.
Review_6 AWT, Swing, ActionListener, and Graphics.
1 Chapter 16: Creating Windows. 2 Basics of GUI Programming How to create a Window. TryWindow.java You always need a JFrame component before creating.
Java Swing One of the most important features of Java is its ability to draw graphics.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Java Graphics Chris North cs3724: HCI. Presentations peter hou Vote: UI Hall of Fame/Shame?
Graphics in Java Opening Discussion zDo you have any questions about the quiz? zWhat did we talk about last class? zDo you have any questions.
Lecture 8:Event Driven Programming Michael Hsu CSULA.
Graphical User Interfaces
Lecture 8:Event Driven Programming
Chapter 16 JavaFX UI Controls and Multimedia
Lecture 8 Object Oriented Programming Using Java
Graphical user interface with Swing by jose maria gonzalez pinto
GUI AND GRAPHICS.
Chapter 16 JavaFX UI Controls and Multimedia
Chapter 7 Creating User Interfaces
Chapter 13 Creating User Interfaces
Liang Book GUI Example Demo
Graphical User Interfaces in Java Event-driven programming
Week 8 Swing NetBeans GUI Builder
Chapter 13 Graphics.
Model, View, Controller design pattern
Chapter 16 JavaFX UI Controls and Multimedia
Chapter 16 JavaFX UI Controls and Multimedia
Chapter 13 Graphics.
Presentation transcript:

Lecture 18 More on GUIs and Graphics Selected examples from Chapters 12, 13, 14, 15 Please read details in the book No need to memorize any of these details!!! HW7: please do something interesting and challenging with user interaction… I will weight this assignment more than the others

Graphics When the system needs to redisplay a window or window component, it calls paintComponent Therefore, when we draw graphics on a swing component such as JPanel or JLabel or a user- defined subclass of one of these, we must put these statements inside an overriding paintComponent method Our program should not call paintComponent. Only the system calls it. When we want to make changes to a graphical display, we have to tell the system to call the overriding paintComponent. We do this by calling repaint().

Demos TestSwingCommonFeatures TestFigurePanel TestMessagePanel DisplayClock –change from a still to a moving clock MoveMessageDemo ClockAnimation ButtonDemo CheckBoxDemo RadioButtonDemo TextFieldDemo TextAreaDemo ComboBoxDemo ScrollBarDemo etc