CIS3931 - Intro to JAVA Lecture Notes Set 7 7-June-05.

Slides:



Advertisements
Similar presentations
Sequence of characters Generalized form Expresses Pattern of strings in a Generalized notation.
Advertisements

Chapter 8 Improving the User Interface
Unit 3 Graphical User Interface (GUI) Dr. Magdi AMER.
1 Chapter 8 Objects and Classes Lecture 2 Prepared by Muhanad Alkhalisy.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Using Maps. A simple map: Hashtable To create a Hashtable, use: import java.util.*; Hashtable table = new Hashtable(); To put things into a Hashtable,
Intro to ArcMap Customization with Visual Basic  Create your own toolbars, buttons, interactive tools, and programs  Runs behind the scenes in ArcMap.
What Is a Collection?  A collection (sometimes called a container) is simply an object that groups multiple elements into a single unit.  Collections.
School of Computing Science CMT1000 Ed Currie © Middlesex University Lecture 4: 1 CMT1000: Introduction to Programming Ed Currie Lecture 5a: Input and.
MENUS AND THE MENU EDITOR Elements of a Menu Menu bar Menu title Separator bar Menu items.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
Chapter 1- Visual Basic Schneider 1 Chapter 1 An Introduction to Computers and Visual Basic.
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Dictionaries Chapter Chapter Contents Specifications for the ADT Dictionary A Java Interface Iterators Using the ADT Dictionary A Directory of Telephone.
Chapter 19 Java Data Structures
Review Data Visualization Process. Text Analysis/Text Mining Derive high-quality information on patterns and trends in the text via statistical pattern.
Sets and Maps Part of the Collections Framework. The Set interface A Set is unordered and has no duplicates Operations are exactly those for Collection.
Chapter 8: String Manipulation
Programming with Microsoft Visual Basic th Edition
Chapter 5 Java Script And Forms JavaScript, Third Edition.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
CHAPTER SIX Reducing Program Complexity General Sub Procedures and Developer-defined Functions.
XP Practical PC, 3e Chapter 2 1 Looking at Windows.
Recitation 1 CS0445 Data Structures Mehmud Abliz.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
(c) University of Washington14-1 CSC 143 Java Collections.
1 Sets and Maps Starring: keySet Co-Starring: Collections.
The Java Collections Framework (Part 2) By the end of this lecture you should be able to: Use the HashMap class to store objects in a map; Create objects.
Dale Roberts GUI Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer.
Regular Expressions.
Sets and Maps Chris Nevison. Set Interface Models collection with no repetitions subinterface of Collection –has all collection methods has a subinterface.
CIS Intro to JAVA Lecture Notes Set June-05 GUI Programming – Assignment 5 Notes.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 24 The String Section.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
Internal Lab Registeration labreg/lab/signup.aspxhttp:// labreg/lab/signup.aspx
Graphical Enablement In this presentation… –What is graphical enablement? –Introduction to newlook dialogs and tools used to graphical enable System i.
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
CHAPTER SIX Reducing Program Complexity General Sub Procedures and Developer-defined Functions.
Sets and Maps Sets Maps The Comparator Interface Sets and Maps in Java Collections API – TreeSet – TreeMap Review for Exam Reading:
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
Set and Map IS 313, Skeletons  Useful coding patterns  Should understand how and why they work how to use  possible quiz material.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
AdditionalControls 1. The MenuStrip 2 Double-click Let’s begin to design the menu bar for VB! Let’s begin to design the menu bar for VB! 3.
Computer Science [3] Java Programming II - Laboratory Course Lab 4 -1 : Introduction to Graphical user interface GUI Components Faculty of Engineering.
Maps Nick Mouriski.
Sets and Maps Part of the Collections Framework. 2 The Set interface A Set is unordered and has no duplicates Operations are exactly those for Collection.
Lecture # 6 Graphical User Interface(GUI). Introduction A graphical user interface (GUI) presents a user- friendly mechanism for interacting with an application.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
1 Maps, Stacks and Queues Maps Reading:  2 nd Ed: 20.4, 21.2, 21.7  3 rd Ed: 15.4, 16.2, 16.7 Additional references: Online Java Tutorial at
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –Boxes, ToolBars, TextFields and glue.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Decision Support System by Simulation Model (Ajarn Chat Chuchuen) 1 Chapter 6 User Interface Management.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
Menu & Clipboard Menu Cut / Copy / Paste. Menus Created in the Menu Editor Can contain menu titles, menu items, separator bars, submenu titles, and submenu.
Topics Graphical User Interfaces Using the tkinter Module
Efficiency of in Binary Trees
JAVA RegEx Manish Shrivastava 11/11/2018.
Predefined Dialog Boxes
"He's off the map!" Topic 9 Maps
VISUAL BASIC FINAL PROGRAMMING PROJECT
Part of the Collections Framework
Maps "He's off the map!" -Stan (Mark Ruffalo) Eternal Sunshine of the Spotless Mind.
Matcher functions boolean find() Attempts to find the next subsequence of the input sequence that matches the pattern. boolean lookingAt() Attempts to.
L5. Necessary Java Programming Techniques
Hashing in java.util
Web Design & Development Lecture 6
Presentation transcript:

CIS Intro to JAVA Lecture Notes Set 7 7-June-05

Maps Maps create a way of storing a value that is accessed via a key (mapping a value to a key) Keys are unique in maps. There can not be two keys with the same name. Each key maps to one value. Values are not unique. Multiple keys may have the same value.

Creating a Map Map map = new TreeMap(); –This creates a Map of type TreeMap Map map = new HashMap(); –This creates a Map of type HashMap Etc …

Map methods clear() – Removes all mappings from a map remove(Object key) – Removes the key and associated value from the map put (Object key, Object value) – Associates the specified value with the specified key putAll(Map t) – Copies all of the mappings from the specified map to this map.

Map methods (cont.) containsKey(Object key) – Returns true if the maps contains a mapping for the specified key containsValue(Object value) – Returns true if this map maps one or more keys to the specified value get(Object key) – Returns the value to which this map maps the specified key.c

Map Example See MapExample.java For more information, see page 942 of your textbook.

Pattern Pattern creates a pattern recognizer using a regular expression Regular expressions info : a/util/regex/Pattern.html a/util/regex/Pattern.html

Pattern To create a pattern –Pattern pattern = Pattern.compile(REGEX); –Where REGEX is a regular expression Example : –Pattern pattern = Pattern.compile(“\\b[a-zA-Z]+\\b”); –Creates a pattern that will match all words with letters A-Z and a- z.

Matcher Uses pattern to grab all the matches out of a string Usage : –Matcher matcher = pattern.matcher(STRING);

Matcher - Methods You will find the following methods useful when writing Assignment 3… find() – attempts to find the next subsequence of the input sequence that matches the pattern. group() – Returns the input subsequence matched by the previous match.

Matcher Example From previously taught class : –regular_expressions.htmlregular_expressions.html See PatternMatcherExample.java

Program 2 Example of finished source code for Program 2…

Program 3 Posted on the Assignment page…

GUI – The Graphical User Interface Read Chapter 11 of the textbook !!! GUI’s will not be on the first midterm. However, they will be on the second midterm and final. Information from Chap. 11 may be in midterm 2 and the final.

GUI Components Buttons Menus Title Bars Menu Bars Combo Boxes Scroll Bars Panels …etc

A Simple GUI Example GUI based I/O using the JOptionPane See GUIAddition.java

Questions?