March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class AdministrativeAdministrative –Office Hours Today CANCELED –Project.

Slides:



Advertisements
Similar presentations
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
Advertisements

Event Driven Programming and GUIs Part 3 CS221 – 4/15/09.
March R. Smith - University of St Thomas - Minnesota QMCS Class Today Handing back the examHanding back the exam ProjectsProjects Certificates.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Tomorrow’s ExamTomorrow’s Exam Today’s LabToday’s Lab SortingSorting.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Three exam questionsThree exam questions Lab with filesLab with.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class AdministrativeAdministrative –Project proposals –This week’s lab Notes.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Designing Graphical ObjectsDesigning Graphical Objects The ‘divide.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Lab 16Lab 16 Filling in an arrayFilling in an array Searching for a.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class More about FunctionsMore about Functions RecursionRecursion.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class IF StatementIF Statement Revisiting assignment statementsRevisiting.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Hard Drives – more laterHard Drives – more later MethodsMethods.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The project assignment, againThe project assignment, again Arrays.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Functions and Array ArgumentsFunctions and Array Arguments ExamExam.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Today: covering through P. 83 of textToday: covering through P. 83 of.
March R. Smith - University of St Thomas - Minnesota Today’s Class RecapRecap More course thingsMore course things Work on labs/projectsWork on labs/projects.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class GradingGrading The examThe exam Sorting arraysSorting arrays Pointers,
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Where we areWhere we are Strings and TextStrings and Text ConditionalsConditionals.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Final Exam ReviewFinal Exam Review –Assessment –Exam Format –C –Matlab.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam StatusExam Status Recap of Lab 7 ExampleRecap of Lab 7 Example.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class I/O ObjectsI/O Objects Lab 12Lab 12.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Young Scholars GrantsYoung Scholars Grants Exam Next TuesdayExam Next.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Today’s LabToday’s Lab SortingSorting.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class End of Chapter 2: READ Section 2.15End of Chapter 2: READ Section.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class HomeworkHomework Nested LoopsNested Loops Other thingsOther things.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Class projectsClass projects Lab 13: Use the method documentation.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230 – Today in Class Getting Homework BackGetting Homework Back DecimalFormat class.
6/22/2015 1R. Smith - University of St Thomas - Minnesota QMCS Class Today St. Lukes Case StudySt. Lukes Case Study.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Return HomeworkReturn Homework Class ScheduleClass Schedule Functions:
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Exam ReviewExam Review Arithmetic - I think everyone gets thisArithmetic.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Rest of semesterRest of semester –More on strings (Chapter 10) –More.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class RecapRecap Functions and CFunctions and C Using FunctionsUsing Functions.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class MethodsMethods Problem solving by decompositionProblem solving by.
March R. Smith - University of St Thomas - Minnesota Today’s Class Lab 1 commentsLab 1 comments Data Types in Chapter 4Data Types in Chapter 4 Lab.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Random NumbersRandom Numbers Output filesOutput files Input filesInput.
6/28/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper recapHistory Paper recap Finish the movieFinish the movie.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Data IndependenceData Independence Matlab #3: Exercise 5.1Matlab #3:
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Buttons: Radio and Check BoxButtons: Radio and Check Box Lab 20Lab.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class StatusStatus –Survey –Returning homework ArraysArrays –What are they?
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Finish up Lab 13Finish up Lab 13 Lab 14 – DetailsLab 14 – Details.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Administrative: do you want another lab?Administrative: do you want.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Matlab “Matrix Laboratory”Matlab “Matrix Laboratory” Chapter 1 – matrices.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Homework & GradesHomework & Grades Multiple DimensionsMultiple Dimensions.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Change in order of topicsChange in order of topics –Starting Chapter.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The ExamThe Exam Homework NotesHomework Notes.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Peek at Lab 16Peek at Lab 16 Side effects and arraysSide effects and.
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
JLabel, JTextField, JButton and JOptionPane
9/21/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class RecapRecap Files, writing filesFiles, writing files 1D Array Recap1D.
1 Event Driven Programming wirh Graphical User Interfaces (GUIs) A Crash Course © Rick Mercer.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
Chapter 8. About the Midterm Exam.. Exam on March 12 Monday (Tentatively) Review on March 7 Wednesday Cover from Chapter 6 Grades will be out before spring.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
5/27/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class RecapRecap Drawing in 2 dimensionsDrawing in 2 dimensions Vertical HistogramVertical.
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.
Applets and Frames. Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L14: GUI Slide 2 Applets Usually.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Grades & Lab 12Grades & Lab 12 Upcoming ExamUpcoming Exam StructuresStructures.
1 GUIs, Layout, Drawing Rick Mercer. 2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces (GUIs)
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class A note on methodsA note on methods ObjectsObjects Creating your.
1/28/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Assignments 7 and 8Assignments 7 and 8 ExamExam History Paper AssignmentHistory.
Creating a GUI Class An example of class design using inheritance and interfaces.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class What’s on the Exam Next Week?What’s on the Exam Next Week? Lab 8Lab.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 17.1 Test-Driving the Student Grades Application.
5-1 GUIs and Events Rick Mercer. 5-2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces to respond.
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Collect PapersCollect Papers Review: Our ZeroesReview: Our Zeroes Review:
A First Look at GUI Applications
Java Programming: From Problem Analysis to Program Design,
Presentation transcript:

March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class AdministrativeAdministrative –Office Hours Today CANCELED –Project Schedule –This Week Schedule About the ExamAbout the Exam Graphical User Interface (GUI)Graphical User Interface (GUI) –See how far we get

March R. Smith - University of St Thomas - Minnesota This Week Schedule Lecture/Lab TomorrowLecture/Lab Tomorrow Lab WednesdayLab Wednesday LABS DUELABS DUE –I will accept Lab 16 THIS WEEK Deduct from grade for being lateDeduct from grade for being late –Same with Lab 17 if not received tomorrow –Lab 18 due NEXT Tuesday

March R. Smith - University of St Thomas - Minnesota Project Schedule Team and project THIS WEEKTeam and project THIS WEEK –Tell me next Monday –What you’re doing; who you’re working with “Design Memo” by December 3“Design Memo” by December 3 –What files/methods you will produce –What inputs and outputs will look like Final Project Due last day of classFinal Project Due last day of class

March R. Smith - University of St Thomas - Minnesota About the Exam Total points = 114 = 100%Total points = 114 = 100% –No “real” extra credit –I reduced the point values of some problems Grades?Grades? –Class median: 89% –Percent = (114 – Missed) / 114 –Above 90% is an A, etc.

March R. Smith - University of St Thomas - Minnesota Working through the answers #1 – People tended to forget “throws”#1 – People tended to forget “throws” –A few wrote headers for something not “main” #2 – It looks like a few people just guessed#2 – It looks like a few people just guessed –Prompting for the filename; FileWriter/PrintWriter for input #3, 4 – almost always right#3, 4 – almost always right #5 – Grammar#5 – Grammar #6-8 – forget return type, arg types, arg names#6-8 – forget return type, arg types, arg names –Extra argument for the return value #9 – Semicolon; double quotes; void#9 – Semicolon; double quotes; void –Mark ‘0’ as undefined; insist on arguments #10 – array; value passed to constructor#10 – array; value passed to constructor #12 – weird grammar#12 – weird grammar #13 – weird grammar; not a constructor#13 – weird grammar; not a constructor #14 – void; String type#14 – void; String type

March R. Smith - University of St Thomas - Minnesota More answers #15 – writing a constructor method#15 – writing a constructor method –Car type = new Car(); // type becomes the variable name #16-8 – size on left hand side#16-8 – size on left hand side #17 – double for size value#17 – double for size value #18 – forgetting “”#18 – forgetting “” #19 – Just needed 0-4#19 – Just needed 0-4 #20 – Starting with 0#20 – Starting with 0 #21-23 – using ArrayList operations#21-23 – using ArrayList operations #21 – Backwards assignment (several)#21 – Backwards assignment (several) –Bad syntax, like an ‘add’ method #23 – using “==“ or = instead of.equals()#23 – using “==“ or = instead of.equals()

March R. Smith - University of St Thomas - Minnesota GUIs – what we’ll do for ‘graphics’ Arranging windows with interface controlsArranging windows with interface controls Example: the bookshelf lab or carpet labExample: the bookshelf lab or carpet lab –Implement with fields to fill in and a “compute” button GUIs depend heavily on objectsGUIs depend heavily on objects –A historical thing –Xerox PARC developed the modern GUI –They used an OO language to do it

March R. Smith - University of St Thomas - Minnesota Examples of GUI Objects A Window (type JFrame)A Window (type JFrame) –Dimensions –A Title –Visibility –“Close” operation (what to do when closing) Window Contents, including…Window Contents, including… Labels (type JLabel)Labels (type JLabel) –Contains settable text Text Field (type JTextField)Text Field (type JTextField) –Contains a readable text field Buttons (type JButton)Buttons (type JButton)

March R. Smith - University of St Thomas - Minnesota Example GUI Objects Can you spot JWindow, JTextField, JLabel, JButton...Can you spot JWindow, JTextField, JLabel, JButton...

March R. Smith - University of St Thomas - Minnesota Our Friend, JFrame What it has: dimensions, visibility, a title, actions, contents, etc.What it has: dimensions, visibility, a title, actions, contents, etc.

March R. Smith - University of St Thomas - Minnesota Creating our own window Windows are objects, let’s create oneWindows are objects, let’s create one Import “javax.swing.*”Import “javax.swing.*” JFrame Win = new JFrame();JFrame Win = new JFrame(); Win.setTitle(“R. Smith’s Object Test Window”);Win.setTitle(“R. Smith’s Object Test Window”); Win.setSize(350, 250);Win.setSize(350, 250); Win.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);Win.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Win.setVisible(true);Win.setVisible(true); Let’s try itLet’s try it

March R. Smith - University of St Thomas - Minnesota To Create a Full GUI… We create customized Window objectsWe create customized Window objects We take JFrame and customize itWe take JFrame and customize it Customizing through inheritanceCustomizing through inheritance When we inherit, we get the existing object features, fields, and methodsWhen we inherit, we get the existing object features, fields, and methods We replace any we want, or add new onesWe replace any we want, or add new ones We get a “normal window” plus what we needWe get a “normal window” plus what we need

March R. Smith - University of St Thomas - Minnesota Creating our own window object It’s an independent object – put in its own fileIt’s an independent object – put in its own file Imports “javax.swing.*”Imports “javax.swing.*” Class declaration “extends JFrame”Class declaration “extends JFrame” Custom Constructor creates the windowCustom Constructor creates the window –Title: setTitle(“R. Smith’s Object Test Window”); –Size: setSize(350, 250); –Close Button: setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); –Visibility: setVisible(true); Let’s try itLet’s try it

March R. Smith - University of St Thomas - Minnesota GUI from the book: KM converter Window Title Label Button Text Field Convert kilometers to milesConvert kilometers to miles

March R. Smith - University of St Thomas - Minnesota Features Label describing what to doLabel describing what to do Text field for the amount to convertText field for the amount to convert Button to “run” the conversionButton to “run” the conversion Option: add a label to hold the answerOption: add a label to hold the answer For now, it won’t do anythingFor now, it won’t do anything

March R. Smith - University of St Thomas - Minnesota Implementation We create a special “converter” window typeWe create a special “converter” window type We create objects for each GUI elementWe create objects for each GUI element We attach the objects to the window objectWe attach the objects to the window object

March R. Smith - University of St Thomas - Minnesota Lab 18: GUI for bookshelf calculation Features of the GUIFeatures of the GUI A label describing how to use itA label describing how to use it Two text fields to collect the dataTwo text fields to collect the data A button to do the calculationA button to do the calculation Another label for outputs and error messagesAnother label for outputs and error messages

March R. Smith - University of St Thomas - Minnesota That’s it. Questions?Questions? Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.