"Java 2 in easy steps" explains the exciting world of Java 2 programming and will guide the reader gently through its powerful features. This book will get the reader started in developing Java 2 applications quickly and easily.
The first chapter begins by introducing Java with guidance on how to download and install the Java Software Development Kit. A simple first program demonstrates how easy Java programming really is.
The author then moves on to "Variables & Operators". This chapter shows how to store program data inside containers called 'variables'. The different types of variable are demonstrated together with all the 'operators' that can be used to manipulate data in a Java program. Areas covered include: Arithmetical Operators; Assignment Operators; Comparison Operators; Logical and Conditional Operators.
Next, "Making Statements" are covered. Statements are used in Java to progress the execution of a program. They may define loops within the code or be expressions to be evaluated. This chapter examines conditional testing and illustrates different types of loops.
Chapter Four deals exclusively with "Using Arrays", and illustrates what they are and how to use them. The examples include a practical use of arrays and how array contents may be sorted into order. It covers: Creating Arrays and Empty Arrays; Array Elements; Read Elements Loop; Sort Numerically and Alphabetically; Two-dimensional Arrays.
The author then moves on to "Doing Mathematics", in a chapter that introduces the Java Math class methods that can be used to perform mathematical calculations. Examples also illustrate formatting of numbers and currency, plus the generation of random numbers.
Chapter Six, "Managing Strings", illustrates how text strings can be manipulated and demonstrates by example, how data can be passed to Java programs at run time. Areas covered are: String Length; Joining Strings; Search a String; Substrings; Comparing Ends and Strings; Passing Data to Programs; Passing Data with JPadPro; Converting Strings; Changing Case; Replace Letters and Spaces.
Moving on to "Methods & Classes", this chapter introduces programs with multiple methods and multiple classes. Examples illustrate how to pass values between methods and the static and void declaration modifiers are explained. Then "Programming with Objects" introduces objects into Java programming. It defines what an object is, how to create new instances of an object and how to use their methods and properties.
Chapter Nine looks at "Handling Errors". It examines the sort of errors that can occur in a Java program and demonstrates how code can be introduced into the program to handle possible errors.
"Interface Components" are then looked at in a chapter that shows how to make Java programs that create windowed applications. Examples demonstrate how to add and layout each of the components that can be used to build a Graphical User Interface (GUI). Areas covered: Creating a Window; Content Containers; Adding Push Buttons; the Push Buttons Program; Adding Labels & Text Fields; Check Boxes & Radio Buttons; Combo Boxes; Slider Components; Text Areas; Adding Scroll Panes; Panel Containers; Flow, Border, Grid and Gridbag Layout Manager.
In Chapter Eleven, "User Interaction" demonstrates how to add features to a program that can handle user input from interface components or from the keyboard. Examples illustrate how user actions create events that can interact with a Java program. The author then moves on to "Applets for the Web", in a chapter that shows how to create Java programs that can be incorporated into a web page and run over the Internet. Examples illustrate how to allow features of the program to be customised from within the host HTML document.
Chapter Thirteen, "Fonts, Colours & Shapes", explores how to specify fonts and colours in Java applications and applets. Examples also demonstrate how to create lines, circles, rectangles and other exciting colour graphics. Next, "Working with Files" illustrates how Java programs can utilise other external files, such as text files, sound files and image files. Examples demonstrate reading and writing with a text file, playing a sound file and adding images to an application.
The final chapter, "Threads & Animation" illustrates how Program Threlooked at, together with archive files and how to go further in Java Chapter 6 - Managing Strings Chapter 7 - Methods & Classes Chapter 8 - Programming with Objects Chapter 9 - Handling Errors Chapter 10 - Interface Components Chapter 11 - User Interaction Chapter 12 - Applets for the Web Chapter 13 - Fonts, Colours & Shapes Chapter 14 - Working with Files Chapter 15 - Threads and Animation