Cover image for Learn Java in a weekend
Title:
Learn Java in a weekend
Author:
Russell, Joseph P. (Joseph Patrick), 1975-
Publication Information:
[Indianapolis, IN] : Premier Press, 2002.
Physical Description:
xxi, 482 pages : illustrations ; 24 cm.
General Note:
Includes index.
Language:
English
ISBN:
9781931841603
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.73.J38 R89 2002 Adult Non-Fiction Non-Fiction Area
Searching...

On Order

Summary

Summary

The author assumes that the reader has some understanding of technology but no programming experience. Learn Java 2 in a Weekend uses a project-oriented approach to teach the basics of Java in a weekend. By the end of the first session, the reader should be able to succesfully be able to programme their first Java program Over the course of the weekend the reader will learn about functions like GUI Programming, sounds, file I/O, and applets.


Table of Contents

Introductionp. xvii
Friday Evening Introducing Javap. 1
What Is Java?p. 4
Java Is a Programming Languagep. 4
Some Java Historyp. 5
What Is Platform Independence?p. 6
Object-Oriented Programming Overviewp. 7
Installing and Setting Up the Java SDKp. 9
Windows Installation and Setupp. 9
Solaris Installationp. 12
Linux Installationp. 13
Troubleshootingp. 14
Take a Breakp. 15
Writing Your First Java Programp. 16
Hello, World!p. 16
Writing the Source Codep. 16
Compiling HelloWorld.javap. 17
Running the HelloWorld.class Filep. 20
Learning Java Syntax Basicsp. 20
Introduction to Appletsp. 25
What Is an Applet?p. 25
Writing a Simple Appletp. 25
Writing the HTMLp. 27
Running the Appletp. 28
Wrapping Upp. 30
Saturday Morning Learning the Basics of Java Programmingp. 31
Learning about Data Types and Using Variablesp. 34
Primitive Data Typesp. 34
Expressing Literalsp. 36
Understanding Stringsp. 41
Declaring and Using Variablesp. 42
Performing Mathematical Operationsp. 47
Using Arraysp. 53
Declaring Arraysp. 54
Initializing Arraysp. 54
Using Array Elementsp. 55
Multidimensional Arraysp. 58
Learning about Methodsp. 61
Declaring Methodsp. 62
Calling Methodsp. 64
Take a Breakp. 66
Object-Oriented Programmingp. 66
Understanding Object-Oriented Programming Conceptsp. 67
Defining Classes in Javap. 68
Constructor Methodsp. 69
Understanding Modifiersp. 75
Creating Subclassesp. 79
More about Stringsp. 85
Creating the CalculatorModel and CalculatorHelper Classesp. 89
Wrapping Upp. 94
Saturday Afternoon Getting Beyond the Basicsp. 97
Defining Conditionsp. 100
Numerical Comparison Operatorsp. 100
Conditional-AND and Conditional-OR Operatorsp. 103
Boolean Logical Operatorsp. 104
The Logical Compliment Operatorp. 107
Object Comparison: equals() and instanceofp. 108
Using Conditional Statementsp. 109
The if Conditional Statementp. 110
The if - else Structurep. 113
The switch Conditional Statementp. 118
The Ternary Conditional Operatorp. 123
A Note about Comparing Stringsp. 126
Repeating Code Using Loopsp. 130
The for Loopp. 130
The while Loopp. 136
The do-while Loopp. 137
Using break and continue to Control Loop Flowp. 139
Take a Breakp. 141
Accepting Command-Line Argumentsp. 141
Passing Arguments at the Command Promptp. 142
Using the args[] Arrayp. 143
Parsing Data Typesp. 145
The Math Classp. 146
Using the Math Class's Methodsp. 146
Using the java.util Packagep. 150
Learning about Collectionsp. 151
Date and Calendar Utilitiesp. 156
Another Way to Generate Random Numbersp. 158
Updating the Calculator Projectp. 160
Updating CalculatorModelp. 160
Updating CalculatorHelperp. 165
Testing Itp. 172
Wrapping Upp. 176
Saturday Evening Graphical User Interface Programmingp. 177
Introduction to GUI Programmingp. 179
What Is a GUI?p. 180
How Does Java Support GUI Programming?p. 180
AWT Components and Event Handlingp. 181
Using Frames and WindowEventsp. 182
The Label Componentp. 189
The Button Component and ActionEventsp. 191
TextFields, TextAreas, and TextEventsp. 193
Choices, Lists, and ItemEventsp. 196
Checkboxes and CheckBoxGroupsp. 201
Canvases and MouseEventsp. 204
Menus and Popup Menusp. 207
The Panel Containerp. 212
Scrollbars and AdjustmentEventsp. 214
ScrollPanesp. 217
Dialog Windowsp. 218
Take a Breakp. 223
Layout Managersp. 223
FlowLayoutp. 223
BorderLayoutp. 225
GridLayoutp. 226
GridBagLayout and GridBagConstraintsp. 228
CardLayoutp. 233
Creating the CalculatorKeypad Componentp. 237
Wrapping Upp. 241
Sunday Morning More GUI, Graphics, and Exception Handlingp. 243
AWT Graphics Programmingp. 245
The Color Classp. 246
Drawing Linesp. 249
Drawing Rectangles and 3-D Rectanglesp. 252
Drawing Round Rectanglesp. 257
Drawing Ovals and Arcsp. 259
Drawing Polygons and Polylinesp. 262
Drawing Stringsp. 267
Drawing Imagesp. 269
Lightweight Componentsp. 272
Creating the LiquidCrystalComponent Classp. 273
Creating the LiquidCrystalDigit Componentp. 280
Creating the LiquidCrystalNegative Componentp. 288
Testing the LiquidCrystal Componentsp. 290
Take a Breakp. 294
Introduction to Swing GUI Programmingp. 294
Overview of the Swing Packagep. 295
Converting CalculatorKeypad to Swingp. 298
Inner Classesp. 302
Anonymous Inner Classesp. 303
Using Adapter Classes for Event Handlingp. 304
Using Exception Handlingp. 307
What Are Exceptions?p. 307
Wrapping Exceptions in try-catch Blocksp. 308
Throwing Exceptionsp. 313
Runtime Exceptions versus Exceptionsp. 316
Creating DigitalDisplayOverflowExceptionp. 317
Creating CalculatorExceptionp. 318
Creating the DigitalDisplay Panelp. 319
Writing the Codep. 320
Testing Itp. 330
Combining It with CalculatorKeypadp. 332
Wrapping Upp. 334
Sunday Afternoon Interfaces, Applets, and Threadsp. 331
Writing Interfacesp. 333
What Is an Interface?p. 334
Defining an Interfacep. 335
Implementing an Interfacep. 336
Rules for Defining and Implementing Interfacesp. 339
Advantages of Using Interfacesp. 341
Creating an Event Model for the Calculatorp. 342
Creating the Event Class and Interfacep. 342
Creating the CalculatorViewer Interfacep. 346
Making Use of the Event Modelp. 348
Writing the CalculatorKeyMap Utilityp. 348
Updating CalculatorKeypadp. 353
Updating the CalculatorView Classp. 359
Updating CalculatorModelp. 362
Updating CalculatorHelperp. 366
Updating and Testing Calculatorp. 373
Writing Java Appletsp. 381
Applet Programmingp. 382
HTML and the Applet Tagp. 383
Passing Parameters to Appletsp. 385
Using the appletviewer Toolp. 388
Running the Calculator as an Appletp. 389
Writing CalculatorAppletp. 389
Writing the HTMLp. 392
Using Threadsp. 393
Extending the Thread Classp. 394
Implementing the Runnable Interfacep. 396
The Thread.sleep() Methodp. 398
Writing Thread-Safe Java Programsp. 400
Wrapping Upp. 406
Sunday Evening Packages, File I/O, JARs, and Javadocsp. 405
What Are Packages?p. 407
Access Modifier Effects on Packagesp. 409
Including a Class in a Packagep. 411
Packaging the Calculator Applicationp. 414
Recompiling the Calculator Applicationp. 416
File Input and Outputp. 419
Overview of the java.io Packagep. 420
Streams, Readers, and Writersp. 422
Reading Standard Inputp. 422
Reading and Writing Filesp. 425
Using the JColorChooser Componentp. 428
Take a Breakp. 433
Saving Calculator Stuffp. 433
Revisiting the Audit Trailp. 434
Adding a Menup. 436
Updating CalculatorViewerp. 441
Saving Color Preferences and the Audit Trailp. 444
The jar Toolp. 456
How to Use the jar Toolp. 457
Creating the calculator.jar Filep. 458
Running JAR Filesp. 461
Using JAR Files from Appletsp. 462
Using the javadoc Toolp. 463
Writing javadoc Commentsp. 463
javadoc Tagsp. 464
Running the javadoc Toolp. 466
Wrapping Upp. 468
Indexp. 469