March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Rest of semesterRest of semester –More on strings (Chapter 10) –More.

Slides:



Advertisements
Similar presentations
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Lab Status?Lab Status? Stuff from the readingStuff from the reading.
Advertisements

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 R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class ProjectsProjects 2 dimensional arrays2 dimensional arrays Higher dimensionsHigher.
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 130: Today’s Class Vectors and DimensionsVectors and Dimensions Scripts (shell scripts)Scripts.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Reading numbers from dialogsReading numbers from dialogs Converting.
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 R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics.
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,
March R. Smith - University of St Thomas - Minnesota QMCS Class Today Attack ExerciseAttack Exercise Attacking serversAttacking servers Firewalls.
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 Reviewing previous workReviewing previous work Using a dialog boxUsing.
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 R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class More on StringsMore on Strings Strings reviewStrings review Character.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class The ProjectThe Project PointersPointers.
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 130: Today’s Class Upcoming Exam – April 8Upcoming Exam – April 8 Structures ReviewStructures.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class The examThe exam Hierarchy of FunctionsHierarchy of Functions Solving.
March R. Smith - University of St Thomas - Minnesota QMCS Class Today Cryptography – introductory termsCryptography – introductory terms “Enigma”
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 /18R. Smith - University of St Thomas - Minnesota QMCS 230 – Today in Class Authorizing OvertimeAuthorizing Overtime Weird Java stuff: conditionals,
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.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class AdministrativeAdministrative –Office Hours Today CANCELED –Project.
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 QMCS 130: Today’s Class The examThe exam –Open book, no notes, like last time Exam TopicsExam.
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 Revised Lab 14/15Revised Lab 14/15 Counting WordsCounting Words Moving.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class About HomeworkAbout Homework Increment/DecrementIncrement/Decrement.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Homework & GradesHomework & Grades Multiple DimensionsMultiple Dimensions.
March R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give.
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 More LoopsMore Loops Do While – a ‘trailing decision’ loopDo While.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Nested For loopsNested For loops IF StatementsIF Statements Else StatementElse.
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.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class AssignmentsAssignments Logical operationsLogical operations Summations.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Final Exam – rest of class scheduleFinal Exam – rest of class schedule.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Grades & Lab 12Grades & Lab 12 Upcoming ExamUpcoming Exam StructuresStructures.
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.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Project Proposals: Due Today!Project Proposals: Due Today! –Identify.
2/22/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper scheduleHistory Paper schedule RecapRecap Plus PlusPlus.
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.
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Collect PapersCollect Papers Review: Our ZeroesReview: Our Zeroes Review:
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Computer HardwareComputer Hardware Recap: next programRecap: next program.
Presentation transcript:

March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Rest of semesterRest of semester –More on strings (Chapter 10) –More on object design (Chapters 6 and 9) Notes on Lab 19Notes on Lab 19 Program (method) designProgram (method) design Graphic bordersGraphic borders

March R. Smith - University of St Thomas - Minnesota Notes on Lab comment for comment for actionPerformed() –Treated this as minor Wrong answer in calculationWrong answer in calculation –Minor unless ‘way’ off Object declaration errors (a few)Object declaration errors (a few) –Wrong object name –Misformed constructor function Declaring it ‘void’ for exampleDeclaring it ‘void’ for example

March R. Smith - University of St Thomas - Minnesota Detailed Design of your program Long programs are hard to debugLong programs are hard to debug If you keep the program short, it’s easierIf you keep the program short, it’s easier Q: How do you keep programs short?Q: How do you keep programs short? A: Break it into separate methods.A: Break it into separate methods. –A method to create a labeled text field –A method to create a radio button group

March R. Smith - University of St Thomas - Minnesota Labeled Text Field Example public JTextBox makeTextPanel (JPanel panel, String s)public JTextBox makeTextPanel (JPanel panel, String s) 1. Create a text box1. Create a text box 2. Create a label with the String2. Create a label with the String 3. Put label in the panel3. Put label in the panel 4. Put text box in the panel4. Put text box in the panel 5. Return the JTextBox reference5. Return the JTextBox reference

March R. Smith - University of St Thomas - Minnesota The challenge Identify what “answers” you need backIdentify what “answers” you need back That decides most of the arrangementThat decides most of the arrangement Input Parameters:Input Parameters: The data you need to make the answersThe data you need to make the answers Answers you need back:Answers you need back: –The panel (always) –Objects that retrieve answers

March R. Smith - University of St Thomas - Minnesota Radio Button Group example Problem: method only returns one “thing”Problem: method only returns one “thing” –Radio buttons have many ‘things’ to look for Solution:Solution: –Create the button group from an array of strings –Return an array of ‘buttons”

March R. Smith - University of St Thomas - Minnesota Button Group Method public JRadioButton[] makeButtonSet (JPanel panel, String[] str)public JRadioButton[] makeButtonSet (JPanel panel, String[] str) –1. create a JRadioButton array the same size as the str array –2. Create a button group object –3. Loop for each string in str a. Create a JRadioButton object a. Create a JRadioButton object b. Save it in the array b. Save it in the array c. Add the button to the panel c. Add the button to the panel d. Add the button to the group object d. Add the button to the group object –4. Return the button array to call:to call: radioList = makeButtonSet (buttonPanel, {"Oak", "Mahogany", "Cherry"});radioList = makeButtonSet (buttonPanel, {"Oak", "Mahogany", "Cherry"});

March R. Smith - University of St Thomas - Minnesota Another Approach to Radio Buttons A customized ‘button group’ objectA customized ‘button group’ object The basic object is a panelThe basic object is a panel –The constructor returns an object usable as a panel –The constructor adds the button functions The button’s “answer” is returned through a methodThe button’s “answer” is returned through a method –Option: return the text of the button –Option: return the button’s number (index) Define numeric constants for the different buttonsDefine numeric constants for the different buttons

March R. Smith - University of St Thomas - Minnesota Borders It’s helpful to put borders around GUI partsIt’s helpful to put borders around GUI parts Indicates which parts go togetherIndicates which parts go together “Title” border – gives a title to related items“Title” border – gives a title to related items –For example, a collection of radio buttons

March R. Smith - University of St Thomas - Minnesota Types of borders Empty border – just some spaceEmpty border – just some space Line border – a simple lineLine border – a simple line Etched border – border with 3D visual effectEtched border – border with 3D visual effect Title border – etched border with titleTitle border – etched border with title Matte border, lowered bevel border, raised bevel border, etc. – other stylesMatte border, lowered bevel border, raised bevel border, etc. – other styles Compound border – uses 2 bordersCompound border – uses 2 borders –Inside is one style, outside is the other

March R. Smith - University of St Thomas - Minnesota Creating a Border Apply the border to a panel:Apply the border to a panel: –panel.setBorder(border); Use BorderFactory methods to create bordersUse BorderFactory methods to create borders –The Factory is NOT an object constructor –It is a set of static methods in the BorderFactory class Examples:Examples: –Panel.setBorder(BorderFactory.createTitledBorder(“Hello”)); –Panel.setBorder(BorderFactory.createLineBorder( Color.Red, 1); - red border, 1 pixel wideColor.Red, 1); - red border, 1 pixel wide

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.