Introduction to Java Programming with JBuilder

by
Edition: 3rd
Format: Paperback
Pub. Date: 2004-01-01
Publisher(s): Prentice Hall
List Price: $113.00

Rent Textbook

Select for Price
There was a problem. Please try again later.

New Textbook

We're Sorry
Sold Out

Used Textbook

We're Sorry
Sold Out

eTextbook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Y. Daniel Liang's popular series of Java texts demonstrates his mastery of Java programming and teaching. Professor Liang's latest work offers a comprehensive, and readily comprehensible, introductory learning tool. The book presents an introduction to the fundamentals of programming, an in-depth treatment of objected-oriented programming, extensive examples of graphics programming and key advanced Java topics. Book jacket.

Author Biography

Y. Daniel Liang is Yamacraw professor at Armstrong Atlantic State University in Savannah, Georgia

Table of Contents

Fundamentals of Programmingp. 1
Introduction to Java and JBuilderp. 3
Introductionp. 4
The History of Javap. 4
Characteristics of Javap. 5
World Wide Web, Java, and Beyondp. 10
The Java Language Specification and APIp. 12
JDK, Java IDE, and JBuilderp. 13
A Simple Java Programp. 14
Anatomy of the Java Program
Getting Started with JBuilderp. 18
Creating a Projectp. 23
Creating, Compiling, and Executing a Java Programp. 27
Displaying Text in a Message Dialog Boxp. 35
Primitive Data Types and Operationsp. 41
Introductionp. 42
Writing Simple Programsp. 42
Identifiersp. 46
Variablesp. 48
Assignment Statements and Assignment Expressionsp. 49
Constantsp. 50
Numeric Data Types and Operationsp. 51
Numeric Type Conversionsp. 56
Character Data Type and Operationsp. 58
Boolean Data Type and Operationsp. 61
Operator Precedence and Associativityp. 64
Operand Evaluation Orderp. 65
Getting Input from Input Dialogsp. 66
Case Studiesp. 70
Programming Style and Documentationp. 76
Programming Errorsp. 80
Debuggingp. 83
Debugging in JBuilderp. 84
Run Java Applications from the Command Linep. 91
JBuilder's Online Helpp. 92
Control Statementsp. 105
Introductionp. 106
Selection Statementsp. 106
Loop Statementsp. 117
Nested Loopsp. 127
Which Loop to Use?p. 129
Using the Keywords break and continuep. 130
Case Studiesp. 134
Debugging Loopsp. 141
Methodsp. 153
Introductionp. 154
Creating a Methodp. 154
Calling a Methodp. 155
Passing Parametersp. 159
Overloading Methodsp. 162
The Scope of Local Variablesp. 167
Method Abstractionp. 168
The Math Classp. 168
Case Studies (Optional)p. 175
Recursion (Optional)p. 182
Arraysp. 205
Introductionp. 206
Declaring Array Variables and Creating Arraysp. 206
Initializing and Processing Arraysp. 208
Copying Arraysp. 214
Passing Arrays to Methodsp. 217
Multidimensional Arraysp. 226
Sorting Arraysp. 234
Searching Arraysp. 237
Object-Oriented Programmingp. 251
Objects and Classesp. 253
Introductionp. 254
Defining Classes for Objectsp. 254
Constructing Objects Using Constructorsp. 255
Accessing Objects via Reference Variablesp. 257
Visibility Modifiers, Accessors, and Mutatorsp. 264
Passing Objects to Methodsp. 270
Static Variables, Constants, and Methodsp. 272
The Scope of Variablesp. 278
The Keyword thisp. 279
Array of Objectsp. 280
Class Abstractionp. 283
Case Studiesp. 283
Inner Classes (Optional)p. 291
Stringsp. 305
Introductionp. 306
The String Classp. 306
The Character Classp. 315
The StringBuffer Classp. 318
The StringTokenizer Classp. 323
Command-Line Argumentsp. 326
Inheritance and Polymorphismp. 335
Introductionp. 336
Superclasses and Subclassesp. 336
Using the Super Keywordp. 338
Overriding Methodsp. 341
The Object Classp. 343
Polymorphism, Dynamic Binding, and Generic Programmingp. 345
Casting Objects and the instanceof Operatorp. 346
Hiding Fields and Static Methods (Optional)p. 351
The Protected Data and Methodsp. 352
The final Classes, Methods, and Variablesp. 354
The finalize, clone, and getClass Methods (Optional)p. 354
Initialization Blocks (Optional)p. 356
Abstract Classes and Interfacesp. 367
Introductionp. 368
Abstract Classesp. 368
The Calendar and GregorianCalendar Classesp. 375
Interfacesp. 376
Processing Primitive Data Type Values as Objectsp. 386
Object-Oriented Modelingp. 399
Introductionp. 400
Analyzing Relationships Among Objectsp. 401
Class Developmentp. 404
The Rational Classp. 413
Class Design Guidelinesp. 419
Modeling Dynamic Behavior Using Sequence Diagrams and Statechartsp. 421
Case Studies (Optional)p. 423
Designing Classes for Linked Lists (Optional)p. 430
Framework-Based Programming Using Java APIp. 438
GUI Programmingp. 445
Getting Started with GUI Programmingp. 447
Introductionp. 448
The Java GUI APIp. 448
Framesp. 452
Layout Managersp. 456
Using Panels as Containersp. 464
Drawing Graphics in Panelsp. 466
The Color Classp. 468
The Font and FontMetrics Classesp. 469
Drawing Geometric Figuresp. 476
Case Studiesp. 485
Event-Driven Programmingp. 505
Introductionp. 506
Event and Event Sourcep. 506
Listeners, Registrations, and Handling Eventsp. 507
Mouse Eventsp. 518
Keyboard Eventsp. 523
Creating User Interfacesp. 531
Introductionp. 532
The Component and JComponent Classesp. 532
Buttonsp. 533
Labelsp. 538
Text Fieldsp. 541
Text Areasp. 544
Combo Boxesp. 549
Listsp. 552
Check Boxesp. 556
Radio Buttonsp. 561
Bordersp. 566
JOptionPane Dialogsp. 573
Menusp. 582
Creating Multiple Windowsp. 590
Scrollbarsp. 594
Scroll Panesp. 598
Tabbed Panesp. 603
Appletsp. 619
Introductionp. 620
The Applet Classp. 620
The JApplet Classp. 622
Creating a Java Applet Using the Applet Wizardp. 623
Viewing Appletsp. 625
The HTML File and the [left angle bracket]applet[right angle bracket] Tagp. 628
Passing Parameters to Appletsp. 632
Enabling Applets to Run as Applicationsp. 635
Case Studies (Optional)p. 638
Developing Comprehensive Projectsp. 653
Exceptions and Assertionsp. 655
Introductionp. 656
Exceptions and Exception Typesp. 656
Understanding Exception Handlingp. 659
Rethrowing Exceptionsp. 667
The finally Clausep. 668
When to Use Exceptionsp. 668
Creating Custom Exception Classes (Optional)p. 669
Assertionsp. 674
Input and Outputp. 685
Introductionp. 686
The File Classp. 686
I/O Streamsp. 691
File Streamsp. 694
Filter Streamsp. 697
Data Streamsp. 698
Print Streamsp. 702
Buffered Streamsp. 704
File Dialogsp. 708
Text Input and Output on the Console (Optional)p. 714
Object Streamsp. 716
Random Access Filesp. 722
Parsing Text Files (Optional)p. 733
Array Streams, Piped Streams, String Streams, Pushback Streams, and Line Number Streams (Optional)p. 736
Java Data Structuresp. 745
Introductionp. 746
The Collection Interface and the AbstractCollection Classp. 747
The Set Interface, and the AbstractSet and HashSet Classesp. 749
The LinkedHashSet Classp. 751
The SortedSet Interface and the TreeSet Classp. 752
The Comparator Interfacep. 754
The List Interface, the AbstractList Class, and the Abstract-SequentialList Classp. 757
The ArrayList and LinkedList Classesp. 758
The Vector Classp. 761
The Stack Classp. 764
The Map Interface, the AbstractMap class, the SortedMap interface, the HashMap, LinkedHashMap, and TreeMap Classesp. 766
The Collections Classp. 772
The Arrays Classp. 776
Multithreadingp. 783
Introductionp. 784
Thread Conceptsp. 784
Creating Threads by Extending the Thread Classp. 785
Creating Threads by Implementing the Runnable Interfacep. 788
Thread Controls and Communicationsp. 791
Thread Statesp. 792
Thread Groupsp. 794
Synchronizationp. 794
Controlling Animation Using Threadsp. 799
Controlling Animation Using the Timer Classp. 803
Multimediap. 817
Introductionp. 818
Playing Audiop. 818
Running Audio on a Separate Threadp. 823
Displaying Imagesp. 825
Loading Image and Audio Files in Java Applicationsp. 828
Displaying a Sequence of Imagesp. 833
Using MediaTrackerp. 836
Appendixesp. 845
Java Keywordsp. 847
The ASCII Character Setp. 851
Operator Precedence Chartp. 855
Java Modifiersp. 859
UML Graphical Notationsp. 861
Classes and Objectsp. 861
The Modifiers public, private, protected, and staticp. 861
Class Relationshipsp. 862
Abstract Classes and Interfacesp. 863
Sequence Diagramsp. 863
Statechart Diagramsp. 863
Special Floating-Point Valuesp. 865
Glossaryp. 867
Indexp. 877
Bonus Chapters (on CD-ROM only)
Internationalization
Introduction
The Locale Class
Processing Date and Time
Formatting Numbers
Resource Bundles (Optional)
Networking
Introduction
Client/Server Computing
The InetAddress Class
Serving Multiple Clients
Applet Clients
Sending and Receiving Objects
The URL class and Viewing Web Pages from Applets
Retrieving Files from Web Servers
Viewing HTML Files Using JEditorPane
Cases Studies (Optional)
Java Database Programming
Introduction
Relational Database Systems
SQL
JDBC
Processing Statements
Retrieving Metadata
A Universal SQL Client
Servlets
Introduction
HTML and Common Gateway Interface
The GET and POST Methods
From CGI to Java Servlets
Creating and Running Servlets from JBuilder
The Servlet API
Creating Servlets
Database Programming Using Servlets
Session Tracking
Sending Images from Servlets
JavaServer Pages
Introduction
A Simple JSP Page
How Is a JSP Page Processed?
Creating and Running JSP from JBuilder
JSP Scripting Constructs
Predefined Variables
JSP Directives
Using JavaBeans in JSP
Getting and Setting Properties
Associating Properties with Input Parameters
Forwarding Requests from JavaServer Pages
Supplements (in the CD-ROM)
Overview of Computer Systems
Introduction
What is a Computer?
Computer Programming
Operating Systems
Number Systems and Bit Manipulations
Introduction
Conversions Between Binary Numbers and Decimal Numbers
Conversions Between Hexadecimal Numbers and Decimal Numbers
Conversions Between Binary Numbers and Hexadecimal Numbers
Bit Manipulations
Java Coding Style Guidelines
Introduction
Appropriate Comments and Comment Styles
Naming Conventions
Proper Indentation and Spacing
Block Styles
Multiple Alternative if-else Style
For-loop Style
While-loop Style
Do-while Style
Try-catch Style
Summary and Example
Compiling and Running Java from the Command Window
Introduction
Introduction
Opening a Command Window
Configuring JDK 1.4
Simple DOS Commands
Creating and Editing Programs Using Notepad
Compiling and Running Java Programs
Frequently Asked Questions
Packages
Introduction
Package-Naming Conventions
The classpath Environment Variable
Putting Classes into Packages
Using Classes/Interfaces from Packages
HTML Tutorial
Getting Started
Structure Tags
Text Appearance Tags
Physical Tags
Paragraph-Style Tags
Font, Size, and Color Tags
List Tags
Table Tags
Hyperlink Tags
Embedding Graphics
More on HTML
CardLayout, GridBagLayout, and Null Layout
Introduction
CardLayout Manager
The GridBagLayout Manager
Using No Layout Manager
Packaging and Deploying Java Projects
Introduction
Java Archive (JAR)
Using the Archive Builder to Package Projects
The Manifest File
Running Archived Projects
Creating Shortcuts for Java Applications on Windows
Event Adapters
Introduction
Extended Event Model
Standard Adapters
Anonymous Adapters
Network Programming Using Datagrams
Introduction
The DatagramPacket and DatagramSocket Classes
Datagram Programming
Using the JBuilder Application Wizard
Introduction
Starting the Application Wizard
The Application Class
The Frame Class
Modifying the Code in the Frame Class
Rapid Java Application Development Using JBuilder
Introduction
JavaBeans
JBuilder Visual Designer
Using JBuilder Visual Designer
Installing and Using Custom Components
Table of Contents provided by Ingram. All Rights Reserved.

Excerpts

To the Instructor Teaching Strategies There are three popular strategies in teaching Java. The first, known asGUI-first,is to mix Java applets and GUI programming with object-oriented programming concepts. The second, known asobject-first,is to introduce object-oriented programming from the start. The third strategy, known asfundamentals-first,is a step-by-step approach, first laying a sound foundation on programming concepts, control statements, methods, and arrays, then introducing object-oriented programming, and then moving on to graphical user interface (GUI), applets, and finally to exception handling, I/O, data structures, multithreading, and multimedia. The GUI-first strategy, starting with GUI and applets, seems attractive, but requires substantial knowledge of object-oriented programming and a good understanding of the Java event-handling model; thus, students may never fully understand what they are doing. The object-first strategy is based on the notion that objects should be introduced first because Java is an object-oriented programming language. This notion, however, overlooks the importance of the fundamental techniques required for writing programs in any programming language. Furthermore, this approach inevitably mixes static and instance variables and methods before students can fully understand classes and objects and use them to develop useful programs. Students are overwhelmed by object-oriented programming and basic rules of programming simultaneously in the early stage of learning Java. This is a common source of frustration for first year students learning object-oriented programming. From my own experience, confirmed by the experiences of many colleagues, I have found that learning basic logic and fundamental programming techniques like loops is a struggle for most first year students.Students who cannot write code in procedural programming are not able to learn object-oriented programming.A good introduction on primitive data types, control statements, methods, and arrays prepares students to learn object-oriented programming. Therefore, this text adopts the fundamentals-first strategy, proceeding at a steady pace through all the necessary and important basic concepts, then moving to object-oriented programming, and then to using the object-oriented approach to build interesting GUI applications and applets with exception handling, I/O, data structures, multithreading, and multimedia as shown in the following diagram. The fundamentals-first approach can reinforce object-oriented programming by demonstrating how procedural solutions can be improved using the object-oriented approach. Students can learn when and how to apply OOP effectively. This book is not simply about how to program, for it teaches, as well, how to solve problems using programs. Applying the concept of abstraction in the design and implementation of software projects is the key to developing software. The overriding objective of the book, therefore, is to teach students to use many levels of abstraction in solving problems and to see problems in small and in large. The examples and exercises throughout the book foster the concept of developing reusable components and using them to create practical projects. Instructor Resources The Instructor's Manual on CD-ROM is available for instructors using this book. It contains the following resources: Microsoft PowerPoint slides for lectures, with interactive buttons to view syntax-highlighted source code and to run programs without leaving the slides. Ten sample exams. In general, each exam has four parts: (I) multiple-choice questions or short answers (most of these are different from the ones in the Self-Test on the Web site); (2) correct programming errors; (3) trace programs; (4) write programs. Solutions to all the exercises. Students will have access to the solutions of even

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.