CS Problem Solving and Object Oriented Programming Spring 2019

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Advertisements

The Problem Decomposition of programs in terms of classes and in terms of crosscutting concerns are both useful, but languages based on source files allow.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 21: Strings (cont.)
CS 180 Problem Solving and Object Oriented Programming Spring 2011 February 16, 2011 Aditya Mathur Department of Computer Science Purdue University West.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 5: September 19-23, 2011 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 13: Nov 14-18, 2011 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 10: Oct 24-28, 2011 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 8: Oct 10-14, 2011 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 4: September 12-16, 2011 Aditya Mathur/Tim Korb Department of Computer.
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 13: Nov 15-19, 2010 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 16: Dec 6-10, 2010 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 9: Oct 17-21, 2011 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for the Final Lecture Dec 7, 2011 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 3: September 5-9, 2011 Aditya Mathur Department of Computer Science Purdue.
1 Session-17 CSIT 121 Spring 2006 Loops: Conditional and Count Controlled Loops: Conditional and Count Controlled LCV: Initialize; Test and Update LCV:
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette Sept 9, 2004 Last update:
Chapter Day 23. © 2007 Pearson Addison-Wesley. All rights reserved Agenda Day 23 Problem set 4 Due Problem set 5 Posted (Last one)  Due Dec 8 Capstones.
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette Sept 20, 2004 Last update:
Exceptions and Assertions Recitation – 03/13/2009 CS 180 Department of Computer Science, Purdue University.
1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 11: Oct 31-Nov 4, 2011 Aditya Mathur Department of Computer Science Purdue.
An Introduction to Visual Basic
CS 235: User Interface Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 3: September 6-10, 2010 Aditya Mathur Department of Computer Science Purdue.
CS 112 Department of Computer Science George Mason University CS 112 Department of Computer Science George Mason University Final Review Lecture 14.
CS 235: User Interface Design September 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Winter 2006CISC121 - Prof. McLeod1 Last Time Misc. useful classes in Java: –String –StringTokenizer –Math –System.
Dale Roberts GUI Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette August 25, 2004 Last update:
Lecture 23: November 30, 2011 Creative Ideas Enabled by Computer Science CS 104 – Fall 2011 Exploring Computer Science.
CS320n – Elements of Visual Programming Course Introduction Mike Scott.
Dialog Boxes.
BOĞAZİÇİ UNIVERSITY DEPARTMENT OF MANAGEMENT INFORMATION SYSTEMS MATLAB AS A DATA MINING ENVIRONMENT.
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 11: Nov 1-5, 2010 Aditya Mathur Department of Computer Science Purdue University.
CS 180 Problem Solving and Object Oriented Programming Fall 2011 Notes for Week 14: Nov 21-25, 2011 Aditya Mathur Department of Computer Science Purdue.
Fall 2012 Professor C. Van Loan Introduction to CSE Using Matlab GUIs CS 1115.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette August 27, 2004 Last update:
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 9: Oct 18-22, 2010 Aditya Mathur Department of Computer Science Purdue.
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 10: Oct 25-29, 2010 Aditya Mathur Department of Computer Science Purdue.
CS 157B: Database Management Systems II April 10 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
 Software provides the instructions that tell the computer what to do.  These instructions are called programs. Programs enable you to use the computer.
Overview Project 2 JFileChooser StringTokenizers Vectors/arrays.
File I/O CLI: File Input CLI: File Output GUI: File Chooser
Department of Computer Science
Section 64 – Manipulating Data Using Methods – Java Swing
CS18000: Problem Solving and Object-Oriented Programming
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
MATLAB/SIMULINK Professor Walter W. Olson
If f(x) = 4x – 3, find each function value.
Project Title This is a sample slide layout
Jayaram KR Graduate Student - Computer Science Purdue University
CS201 Fall 2016 George Koutsogiannakis
CS148 Introduction to Programming II
Life is Full of Alternatives
ASP.net MVC Model Haiming Chen Department of Computer Science
If f(x) = 4x – 3, find each function value.
Solve for x in #1-3. #1. x + 9 = 15 #2. x – 2 = 10 #3. 6x = 30 #4
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
CS Problem Solving and Object Oriented Programming Spring 2019
ME 123 Computer Applications I Lecture 7: Basic Functions 3/20/03
Presentation transcript:

CS 18000 Problem Solving and Object Oriented Programming Spring 2019 Section LE2 Week 10: Lecture 21, March 27. 2019 Slides updated: 9:30am, March 27, 2019 Aditya Mathur Professor, Department of Computer Science Purdue University West Lafayette, IN, USA https://www.cs.purdue.edu/homes/apm/courses/CS180Spring2019/

©Aditya Mathur. CS 180. Fall 2019.Week 12 Today (Continued) Interaction through Graphical User Interfaces (GUIs) JFileChooser JOptionPane (extend and complete the program from Monday) 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser Enables navigation across the file system on your computer Creates a dialog Modal dialog https://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser: The dialog JFileChooser fc=new JFileChooser(); // Create a file chooser object int response=fc.showOpenDialog(null); // Open the (open) dialog and check the status of user action parent int response=fc.showSaveDialog(null); // Open the (save) dialog and check the status of user action 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser: Sample (Open) dialog 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser: Check user response // If the user has selected a file to open then the return value will be equal to JFileChooser.APPROVE_OPTION. if (response==JFileChooser.APPROVE_OPTION){ File selectedFile=fc.getAbsolutePath(); 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser: Obtain file path or name File fileObject=fc.getSelectedFile(); // Get selected file object String filePath=selectedFile.getAbsolutePath(); // Get file path // Get file name String fileName=selectedFile.getName(); 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 JFileChooser: Customization fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // Show only directories // Filter 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

Live demo [Pre-programmed] 180PizzaGrab 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 Select pizza data file 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 Select pizza 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 Select size 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 Select payment type 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 Eat! 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12

©Aditya Mathur. CS 180. Fall 2019.Week 12 Quiz: 03/27/2019 03/27/2019 ©Aditya Mathur. CS 180. Fall 2019.Week 12