5 Enhancing the Inventory Application 88 Introducing Variables, Memory Concepts, Arithmetic and Keyboard Events



Similar documents
Computing Concepts with Java Essentials

Course Number: IAC-SOFT-WDAD Web Design and Application Development

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

Java the UML Way: Integrating Object-Oriented Design and Programming

Artificial Intelligence. Class: 3 rd

Specialized Programme on Web Application Development using Open Source Tools

Accessing Microsoft Access Database

Java Application Developer Certificate Program Competencies

Syllabus for CS 134 Java Programming

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

Specialized Programme on Web Application Development using Open Source Tools

Management Information Systems 260 Web Programming Fall 2006 (CRN: 42459)

Web Development in Java

Java (12 Weeks) Introduction to Java Programming Language

Java EE Web Development Course Program

BHARATHIAR UNIVERSITY COIMBATORE SCHOOL OF DISTANCE EDUCATION

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

#820 Computer Programming 1A

Fundamentals of Java Programming

GUIs with Swing. Principles of Software Construction: Objects, Design, and Concurrency. Jonathan Aldrich and Charlie Garrod Fall 2012

Computer Programming I

Japan Communication India Skill Development Center

Introduction to Programming System Design. CSCI 455x (4 Units)

Japan Communication India Skill Development Center

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Japan Communication India Skill Development Center

Japan Communication India Skill Development Center

Lab 9. Spam, Spam, Spam. Handout 11 CSCI 134: Spring, To gain experience with Strings. Objective

Assignment # 2: Design Patterns and GUIs

Chapter 13: Program Development and Programming Languages

Summit Public Schools Summit, New Jersey Grade Level / Content Area: Mathematics Length of Course: 1 Academic Year Curriculum: AP Computer Science A

NetBeans IDE Field Guide

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

Swing. A Quick Tutorial on Programming Swing Applications

Curriculum Map. Discipline: Computer Science Course: C++

THE OPEN UNIVERSITY OF TANZANIA

Bookstore Web Application

The C Programming Language course syllabus associate level

VISUAL C++.NET. How TO PROGRAM. H. M. Deitel Deitel & Associates, Inc. P. J. Deitel Deitel & Associates, Inc. J. P. Liperi Microsoft Corporation

Chapter 6: Programming Languages

Visual Basic. murach's TRAINING & REFERENCE

I PUC - Computer Science. Practical s Syllabus. Contents

Java and J2EE (SCJA Exam CX ) 50 Cragwood Rd, Suite 350 South Plainfield, NJ 07080

Applets, RMI, JDBC Exam Review

EMC Publishing. Ontario Curriculum Computer and Information Science Grade 11

Java SE 8 Programming

CS 335 Lecture 06 Java Programming GUI and Swing

El Dorado Union High School District Educational Services

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

For Introduction to Java Programming, 5E By Y. Daniel Liang

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

OKLAHOMA SUBJECT AREA TESTS (OSAT )

Computer and Information Sciences

Course Title: Software Development

DIPLOMADO DE JAVA - OCA

Chapter 13: Program Development and Programming Languages

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

Chapter 2: Algorithm Discovery and Design. Invitation to Computer Science, C++ Version, Third Edition

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PLV Goldstein 315, Tuesdays and Thursdays, 6:00PM-7:50PM. Tuesdays and Thursdays, 4:00PM-5:30PM and 7:50PM 9:30PM at PLV G320

DiskPulse DISK CHANGE MONITOR

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

Enterprise Java. Where, How, When (and When Not) to Apply Java in Client/Server Business Environments. Jeffrey Savit Sean Wilcox Bhuvana Jayaraman

Fundamentals of Programming and Software Development Lesson Objectives

Stage 5 Information and Software Technology

Glossary of Object Oriented Terms

Computer Programming I

An Introduction to Object-Oriented Programming with

Programming and Software Development (PSD)

Computer Science III Advanced Placement G/T [AP Computer Science A] Syllabus

LAMP [Linux. Apache. MySQL. PHP] Industrial Implementations Module Description

EKT150 Introduction to Computer Programming. Wk1-Introduction to Computer and Computer Program

Higher Computing Science Course Assessment Specification (C716 76)

COMPUTER SCIENCE (5651) Test at a Glance

Windows PowerShell Essentials

CS506 Web Design and Development Solved Online Quiz No. 01

C# Cookbook. Stephen Teilhet andjay Hilyard. O'REILLY 8 Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo '"J""'

IBM Tivoli Security Administrator for RACF IBM. User s Guide. Version 1.1 SC

Programming and Software Development CTAG Alignments

Computer Programming I & II*

Tutorial 5: Developing Java applications

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Using SQL Developer. Copyright 2008, Oracle. All rights reserved.

SQL Basics for RPG Developers

ARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT,

Android Application Development Course Program

Microsoft Access is an outstanding environment for both database users and professional. Introduction to Microsoft Access and Programming SESSION

1/20/2016 INTRODUCTION

Oracle Database: SQL and PL/SQL Fundamentals

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

GUI Components: Part 2

Skills for Employment Investment Project (SEIP)

Transcription:

CO N T E N T S 1 Moving Shapes Application 1 Introducing Computers, the Internet and Java Programming 1.1 What Is a Computer? 1 1.2 Computer Organization 2 1.3 Machine Languages, Assembly Languages and High-Level Languages 3 1.4 Java 5 1.5 Other High-Level Languages 6 1.6 Structured Programming 7 1.7 Key Software Trend: Object Technology 7 1.8 The Internet and the World Wide Web 8 1.9 The Java Runtime Environment (JRE) 10 1.10 Test-Driving the Moving Shapes Application 11 1.11 Internet and Web Resources 16 1.12 Wrap-Up 16 2 Welcome Application 21 Introduction to Graphical User Interface Programming 2.1 Test-Driving the Welcome Application 21 2.2 Compiling and Running the Template Welcome Application 22 2.3 Constructing the Welcome Application 24 2.4 Syntax Errors 35 2.5 Wrap-Up 37 3 Designing the Inventory Application 48 Introducing JTextFields and JButtons 3.1 Test-Driving the Inventory Application 48 3.2 Customizing JLabels in the Inventory Application 50 3.3 Customizing JTextFields and a JButton in the Inventory Application 52 3.4 Wrap-Up 58 4 Completing the Inventory Application 67 Introducing Programming 4.1 Test-Driving the Inventory Application 67 4.2 Introduction to Java Code 68 4.3 Placing Code in an Event Handler 70 4.4 Performing a Calculation and Displaying the Result 74 4.5 Wrap-Up 79 5 Enhancing the Inventory Application 88 Introducing Variables, Memory Concepts, Arithmetic and Keyboard Events i simplyjava1_01toc.fm June 5, 2003 1:40 pm

ii 5.1 Test-Driving the Enhanced Inventory Application 88 5.2 Variables 89 5.3 Handling the keypressed event for a JTextField 93 5.4 Memory Concepts 98 5.5 Arithmetic 99 5.6 Using the Debugger: Breakpoints and the run, stop, cont and print Commands 101 5.7 Internet and Web Resources 105 5.8 Wrap-Up 106 6 Wage Calculator Application 114 Introducing Algorithms, Pseudocode and Program Control 6.1 Test-Driving the Wage Calculator Application 114 6.2 Algorithms 115 6.3 Pseudocode 116 6.4 Control Statements 117 6.5 if Selection Statement 119 6.6 if else Selection Statement 121 6.7 Constructing the Wage Calculator Application 124 6.8 Assignment Operators 128 6.9 Formatting Text 130 6.10 Using the Debugger: The print and set Commands 134 6.11 Wrap-Up 137 7 Dental Payment Application 148 Introducing JCheckBoxes, Message Dialogs and Logical Operators 7.1 Test-Driving the Dental Payment Application 148 7.2 Constructing the Dental Payment Application 150 7.3 Using JCheckBoxes 151 7.4 Using a Dialog to Display a Message 155 7.5 Logical Operators 160 7.6 Wrap-Up 169 8 Car Payment Calculator Application 180 Introducing the while Repetition Statement and JTextAreas 8.1 Test-Driving the Car Payment Calculator Application 180 8.2 while Repetition Statement 182 8.3 Increment and Decrement Operators 184 8.4 Constructing the Car Payment Calculator Application 186 8.5 Wrap-Up 197 9 Class Average Application 206 Introducing the do while Repetition Statement 9.1 Test-Driving the Class Average Application 206 9.2 do while Repetition Statement 208 9.3 Creating the Class Average Application 210 9.4 Wrap-Up 221 10 Interest Calculator Application 231 Introducing the for Repetition Statement 10.1 Test-Driving the Interest Calculator Application 231 10.2 Essentials of Counter-Controlled Repetition 235 10.3 Introducing the for Repetition Statement 236

iii 10.4 Examples Using the for Statement 238 10.5 Constructing the Interest Calculator Application 239 10.6 Wrap-Up 250 11 Security Panel Application 284 Introducing the switch Multiple-Selection Statement, Date and DateFormat 11.1 Test-Driving the Security Panel Application 284 11.2 Introducing the switch Multiple-Selection Statement 287 11.3 Constructing the Security Panel Application 290 11.4 Wrap-Up 305 12 Enhancing the Wage Calculator Application 341 Introducing Methods 12.1 Test-Driving the Enhanced Wage Calculator Application 341 12.2 Classes and Methods 342 12.3 Method Declarations 343 12.4 Finishing the Maximum Application 350 12.5 Using Methods in the Wage Calculator Application 353 12.6 Using the Debugger: Controlling Execution Using the step, step up and next Commands 359 12.7 Wrap-Up 363 13 Enhancing the Interest Calculator Application 397 Introduction to Event Handling 13.1 Test-Driving the Enhanced Interest Calculator Application 397 13.2 Event Handlers 400 13.3 Event Handler Registration 403 13.4 Handling a ChangeEvent 407 13.5 Wrap-Up 414 14 Fundraiser Application 443 Introducing Scope and Conversion of Primitive Types 14.1 Test-Driving the Fundraiser Application 443 14.2 Constructing the Fundraiser Application 444 14.3 Conversions 447 14.4 Wrap-Up 455 15 Craps Game Application 481 Introducing Random Number Generation and the JPanel 15.1 Test-Driving the Craps Game Application 481 15.2 Random Number Generation 483 15.3 Using Constants in the Craps Game Application 485 15.4 Using Random Numbers in the Craps Game Application 491 15.5 Wrap-Up 501 16 Flag Quiz Application 531 Introducing One-Dimensional Arrays and JComboBoxes 16.1 Test-Driving the Flag Quiz Application 531 16.2 Introducing Arrays 533 16.3 Declaring and Creating Arrays 535 16.4 Constructing the Flag Quiz Application 538 16.5 Sorting Arrays 549 16.6 Wrap-Up 555

iv 17 Student Grades Application 587 Introducing Two-Dimensional Arrays and JRadioButtons 17.1 Test-Driving the Student Grades Application 587 17.2 Two-Dimensional Arrays 589 17.3 Using JRadioButtons 591 17.4 Inserting Code into the Student Grades Application 594 17.5 Wrap-Up 609 18 Microwave Oven Application 645 Building Your Own Classes and Objects 18.1 Test-Driving the Microwave Oven Application 646 18.2 Designing the Microwave Oven Application 648 18.3 Initializing Objects: Constructors 652 18.4 Get and Set Methods 654 18.5 Completing the Microwave Oven Application 658 18.6 Controlling Access to Members 663 18.7 The main Method 675 18.8 Using the Debugger: The watch Command 676 18.9 Wrap-Up 679 19 Shipping Hub Application 731 Introducing Collections, ArrayList and Iterators 19.1 Test-Driving the Shipping Hub Application 731 19.2 Parcel Class 736 19.3 JList Component 737 19.4 Using Mnemonics (Keyboard Shortcuts) 738 19.5 Collections 739 19.6 Constructing the Shipping Hub Application 740 19.7 Using Iterators 756 19.8 Wrap-Up 776 20 Screen Saver Application 831 Introducing Inheritance and Graphics 20.1 Test-Driving the Screen Saver Application 831 20.2 Inheritance Overview 833 20.3 Graphics Overview 835 20.4 Creating the Screen Saver Application 836 20.5 Using Inheritance to Create the MyRectangle Class 837 20.6 Graphics in Java 840 20.7 Completing the Screen Saver Application 845 20.8 Wrap-Up 851 21 Cat and Mouse Painter Application 891 Introducing Interfaces, Mouse Input; the Event-Handling Mechanism 21.1 Test-Driving the Painter Application 891 21.2 Constructing the Painter Application 893 21.3 Interfaces 895 21.4 The mousepressed Event Handler 897 21.5 The mousereleased Event Handler 900 21.6 The mousedragged Event Handler 903 21.7 Wrap-Up 910 22 Typing Skills Developer Application 945 Introducing Keyboard Events and JMenus

v 22.1 Test-Driving the Typing Skills Developer Application 945 22.2 Keyboard Events 949 22.3 JMenus 954 22.4 JColorChooser 958 22.5 Wrap-Up 975 23 Screen Scraping Application 1013 Introducing String Processing 23.1 Test-Driving the Screen Scraping Application 1013 23.2 Fundamentals of Strings 1016 23.3 Constructing the Screen Scraping Application 1017 23.4 Locating Substrings in Strings 1017 23.5 Extracting Substrings from Strings 1021 23.6 Other String Methods 1023 23.7 Wrap-Up 1027 24 Enhanced Car Payment Calculator Application 1057 Introducing Exception Handling 24.1 Test-Driving the Enhanced Car Payment Calculator Application 1057 24.2 Introduction to Exception Handling 1060 24.3 Exception Handling in Java 1061 24.4 Java Exception Hierarchy 1062 24.5 Constructing the Enhanced Car Payment Calculator Application 1064 24.6 Wrap-Up 1071 25 Ticket Information Application 1104 Introducing Sequential-Access Files 25.1 Test-Driving the Write Event and Ticket Information Applications 1104 25.2 Data Hierarchy 1109 25.3 Files and Streams 1111 25.4 Creating the Write Event Application: Writing to a File 1112 25.5 Creating the Ticket Information Application 1127 25.6 Using the finally Clause 1133 25.7 Wrap-Up 1141 26 ATM Application 1175 Introducing Database Programming and Using Command-Line Arguments 26.1 IBM Cloudscape Database 1175 26.2 Test-Driving the ATM Application 1181 26.3 Planning the ATM Application 1187 26.4 Relational Database Overview: The ATM Database 1190 26.5 SQL 1192 26.6 Using Command-Line Arguments 1194 26.7 Creating Database Connections 1195 26.8 Programming the ATM Application 1199 26.9 Wrap-Up 1220 27 Drawing Shapes Application 1285 Introduction to Polymorphism; an Expanded Discussion of Graphics 27.1 Test-Driving the Drawing Shapes Application 1285 27.2 Polymorphism 1288 27.3 More Graphics Methods 1289

vi 27.4 Adding to the MyShape Inheritance Hierarchy 1298 27.5 Wrap-Up 1309 28 Phone Book Application 1361 Introducing the Java Speech API 28.1 Java Speech API 1361 28.2 Downloading and Installing FreeTTS 1362 28.3 Test-Driving the Phone Book Application 1365 28.4 Constructing the Phone Book Application 1366 28.5 Wrap-Up 1375 29 Bookstore Web Application: 1423 Introducing Web Applications and the Apache Tomcat Web Server 29.1 Multi-Tier Architecture 1424 29.2 Web Servers 1425 29.3 Apache Tomcat Web Server 1426 29.4 Test-Driving the Bookstore Web Application 1431 29.5 Wrap-Up 1434 30 Bookstore Web Application: Client Tier 1445 Introducing HTML 30.1 Analyzing the Bookstore Web Application 1445 30.2 Creating JavaServer Pages 1446 30.3 Creating the books.jsp Page 1446 30.4 Creating the bookinformation.jsp Page 1450 30.5 Wrap-Up 1456 31 Bookstore Web Application: Information Tier 1483 Examining the Database and Creating Database Components 31.1 Reviewing the Bookstore Web Application 1483 31.2 Information Tier: Database 1484 31.3 Using the Cloudscape Database in JSP Pages 1485 31.4 Wrap-Up 1497 32 Bookstore Web Application: Middle Tier 1519 form Attributes method/action and Inserting Query Results in a JSP 32.1 Reviewing the Bookstore Web Application 1519 32.2 Adding Functionality to the books.jsp Page 1520 32.3 Adding Functionality to the bookinformation.jsp Page 1524 32.4 Internet and Web Resources 1532 32.5 Wrap-Up 1532 A Operator Precedence Chart 1369 B ASCII Character Set 1372 C GUI Design Guidelines 1373 D Java Library Reference 1382 E Keyword Chart 1406

Tutorial vii F Primitive Types 1409