Starting Out with Java: From Control Structures through Objects, Global Edition

Höfundur: Tony Gaddis (Útgáfa: 8)
Starting Out with Java: From Control Structures through Objects, Global Edition

Kaup valmöguleikar

With RevelĀ® for Starting Out with Java: Control Structures Through Objects, CS1 author and instructor Tony Gaddis uses a step-by-step approach to introduce students to programming in Java. Procedural programming, control structures and methods, is covered before object-oriented programming to ensure that students understand fundamental programming and problem-solving concepts. Every chapter includes clear and easy-to-read code listings, concise and practical real-world examples, focused explanations, and an abundance of exercises.

Nánar um bókina

Útgefandi
Pearson International Content
ISBN
9781292721569
Print ISBN
9781292453248
Format
ePub
Útgáfa
8
Höfundar
Tony Gaddis
Tungumál
English
Útgefið
2024-11-28
Prent takmörkun á líftíma
100
Prent takmörkun
2
Afritunar takmörkun
2

Kaflar

  • Welcome
  • Cover
  • Inside Front Cover
  • Title Page
  • Copyright
  • Contents at a Glance
  • Contents
  • Location of Videonotes
  • Preface
  • Control Structures First, Then Objects
  • Content Highlights
  • Organization of the Text
  • Brief Overview of Each Chapter
  • Features of the Text
  • Acknowledgments
  • Acknowledgments for the Global Edition
  • About the Author
  • 1: Introduction to Computers and Java
  • 1: Topics
  • 1.1: Introduction
  • 1.1: Introduction
  • 1.2: Why Program?
  • 1.2: Why Program?
  • 1.3: Computer Systems: Hardware and Software
  • 1.3: Computer Systems: Hardware and Software
  • Main Memory
  • Secondary Storage
  • Software
  • 1.4: Programming Languages
  • 1.4: Programming Languages
  • A History of Java
  • 1.5: What Is a Program Made Of?
  • 1.5: What Is a Program Made of?
  • Lines and Statements
  • Variables
  • The Compiler and the Java Virtual Machine
  • Compiling and Running a Java Program
  • 1.6: The Programming Process
  • 1.6: The Programming Process
  • 1. Clearly define what the program is to do
  • 2. Visualize the program running on the computer
  • 3. Use design tools to create a model of the program
  • 4. Check the model for logical errors
  • 7. Run the program with test data for input
  • Software Engineering
  • 1.7: Object-Oriented Programming
  • 1.7: Object-Oriented Programming
  • Chapter 1: Review Questions and Exercises
  • Chapter 1: Review Questions and Exercises
  • Chapter 1: Programming Challenges
  • Chapter 1: Programming Challenges
  • 2: Java Fundamentals
  • 2: Topics
  • 2.1: The Parts of a Java Program
  • 2.1: The Parts of a Java Program
  • 2.2: The print and println Methods, and the Java API
  • 2.2: The print and println Methods, and the Java API
  • The print Method
  • 2.3: Variables and Literals
  • 2.3: Variables and Literals
  • Displaying Multiple Items with the + Operator
  • Be Careful With Quotation Marks
  • More about Literals
  • Identifiers
  • 2.4: Primitive Data Types
  • 2.4: Primitive Data Types
  • The Integer Data Types
  • Floating-Point Data Types
  • The boolean Data Type
  • The char Data Type
  • Variable Assignment and Initialization
  • Variables Hold Only One Value at a Time
  • 2.5: Arithmetic Operators
  • 2.5: Arithmetic Operators
  • Integer Division
  • Operator Precedence
  • Grouping with Parentheses
  • In the Spotlight: Calculating Percentages and Discounts
  • The Math Class
  • 2.6 Introduction to Jshell
  • 2.6 Introduction to Jshell
  • 2.7: Combined Assignment Operators
  • 2.7: Combined Assignment Operators
  • JShell Experiment: Using Combined Assignment Operators
  • 2.8: Conversion between Primitive Data Types
  • 2.8: Conversion between Primitive Data Types
  • Cast Operators
  • Mixed Integer Operations
  • Other Mixed Mathematical Expressions
  • 2.9: Creating Named Constants with final
  • 2.9: Creating Named Constants with final
  • 2.10: The String Class
  • 2.10: The String Class
  • Primitive Type Variables and Class Type Variables
  • Creating a String Object
  • 2.11: Scope
  • 2.11: Scope
  • 2.12: Declaring Local Variables with the var Keyword
  • 2.12: Declaring Local Variables with the var Keyword
  • JShell Experiment: Declaring Variables with var
  • 2.13: Comments
  • 2.13: Comments
  • Multi-Line Comments
  • Documentation Comments
  • 2.14: Programming Style
  • 2.14: Programming Style
  • 2.15: Reading Keyboard Input
  • 2.15: Reading Keyboard Input
  • Reading a Character
  • Mixing Calls to nextLine with Calls to Other Scanner Methods
  • Declaring Scanner Variables with the var Keyword
  • 2.16: Common Errors to Avoid
  • 2.16: Common Errors to Avoid
  • Chapter 2: Review Questions and Exercises
  • Chapter 2: Review Questions and Exercises
  • Chapter 2: Programming Challenges
  • Chapter 2: Programming Challenges
  • 3: Decision Structures
  • 3: Topics
  • 3.1: The if Statement
  • 3.1: The if Statement
  • Using Relational Operators to Form Conditions
  • Putting It All Together
  • Programming Style and the if Statement
  • Be Careful with Semicolons
  • Having Multiple Conditionally Executed Statements
  • Flags
  • Comparing Characters
  • JShell Experiment: Evaluating Relational Expressions and Using if Statements
  • 3.2: The if-else Statement
  • 3.2: The if-else Statement
  • 3.3: Nested if Statements
  • 3.3: Nested if Statements
  • In the Spotlight: Multiple Nested Decision Structures
  • 3.4: The if-else-if Statement
  • 3.4: The if-else-if Statement
  • Using the Trailing else to Catch Errors
  • 3.5: Logical Operators
  • 3.5: Logical Operators
  • The && Operator
  • The || Operator
  • The ! Operator
  • The Precedence of Logical Operators
  • Checking Numeric Ranges with Logical Operators
  • JShell Experiment: Evaluating Boolean Expressions with Logical Operators
  • 3.6: Comparing String Objects
  • 3.6: Comparing String Objects
  • Ignoring Case in String Comparisons
  • 3.7: More about Variable Declaration and Scope
  • 3.7: More about Variable Declaration and Scope
  • 3.8: The Conditional Operator
  • 3.8: The Conditional Operator
  • JShell Experiment: The Conditional Operator
  • 3.9: The switch Statement
  • 3.9: The switch Statement
  • Multi Value case Statements (Java 12 and Later)
  • Arrow case Syntax (Java 12 and Later)
  • Switch Expressions (Java 12 and Later)
  • 3.10: Displaying Formatted Output with System.out.printf and String.format
  • 3.10: Displaying Formatted Output with System.out.printf and String.format
  • Format Specifier Syntax
  • Specifying a Minimum Field Width
  • Flags
  • Padding Numbers with Leading Zeros
  • Formatting String Arguments
  • The String.format Method
  • 3.11: Common Errors to Avoid
  • 3.11: Common Errors to Avoid
  • Chapter 3: Review Questions and Exercises
  • Chapter 3: Review Questions and Exercises
  • Chapter 3: Programming Challenges
  • Chapter 3: Programming Challenges
  • 4: Loops and Files
  • 4: Topics
  • 4.1: The Increment and Decrement Operators
  • 4.1: The Increment and Decrement Operators
  • The Difference between Postfix and Prefix Modes
  • 4.2: The while Loop
  • 4.2: The while Loop
  • The while Loop is a Pretest Loop
  • Infinite Loops
  • Don't Forget the Braces with a Block of Statements
  • JShell Experiment: Using the while Loop
  • In the Spotlight: Designing a Program with a while Loop
  • 4.3: Using the while Loop for Input Validation
  • 4.3: Using the while Loop for Input Validation
  • 4.4: The do-while Loop
  • 4.4: The do-while Loop
  • 4.5: The for Loop
  • 4.5: The for Loop
  • The for Loop is a Pretest Loop
  • Creating a User Controlled for Loop
  • Using Multiple Statements in the Initialization and Update Expressions
  • In The Spotlight: Designing a Count-Controlled for Loop
  • 4.6: Running Totals and Sentinel Values
  • 4.6: Running Totals and Sentinel Values
  • Using a Sentinel Value
  • 4.7: Nested Loops
  • 4.7: Nested Loops
  • In the Spotlight: Using Nested Loops to Print Patterns
  • 4.8: The break and continue Statements (Optional)
  • 4.8: The Break and Continue Statements (Optional)
  • 4.9: Deciding Which Loop to Use
  • 4.9: Deciding Which Loop to Use
  • 4.10: Introduction to File Input and Output
  • 4.10: Introduction to File Input and Output
  • Using the PrintWriter Class to Write Data to a File
  • Appending Data to a File
  • Reading Data from a File
  • The Read Position
  • Detecting the End of a File
  • Reading Primitive Values From a File
  • Checking for a File's Existence
  • Managing Resources with the try-with-resources Statement
  • Declaring Multiple Objects with a try Statement
  • 4.11: Generating Random Numbers with the Random Class
  • 4.11: Generating Random Numbers with the Random Class
  • In the Spotlight: Using Random Numbers
  • In the Spotlight: Using Random Numbers to Represent Other Values
  • 4.12: Common Errors to Avoid
  • 4.12: Common Errors to Avoid
  • Chapter 4: Review Questions and Exercises
  • Chapter 4: Review Questions and Exercises
  • Chapter 4: Programming Challenges
  • Chapter 4: Programming Challenges
  • 5: Methods
  • 5: Methods
  • 5.1: Introduction to Methods
  • 5.1: Introduction to Methods
  • Defining a void Method
  • Calling a Method
  • Layered Method Calls
  • Using Documentation Comments with Methods
  • JShell Experiment: Defining and Calling Methods in JShell
  • 5.2: Passing Arguments to a Method
  • 5.2: Passing Arguments to a Method
  • Argument and Parameter Data Type Compatibility
  • Arguments are Passed By Value
  • Passing Object References to a Method
  • Using the @param Tag in Documentation Comments
  • 5.3: More about Local Variables
  • 5.3: More about Local Variables
  • 5.4: Returning a Value from a Method
  • 5.4: Returning a Value from a Method
  • Calling a Value-Returning Method
  • Using the @return Tag in Documentation Comments
  • In The Spotlight: Using Value-Returning Methods
  • JShell Experiment: Defining and Calling a Value-Returning Method
  • Returning a boolean Value
  • Returning a Reference to an Object
  • 5.5: Problem Solving with Methods
  • 5.5: Problem Solving with Methods
  • Calling Methods that Throw Exceptions
  • 5.6: Common Errors to Avoid
  • 5.6: Common Errors to Avoid
  • Chapter 5: Review Questions and Exercises
  • Chapter 5: Review Questions and Exercises
  • Chapter 5: Programming Challenges
  • Chapter 5: Programming Challenges
  • 6: A First Look at Classes
  • 6: Topics
  • 6.1: Objects and Classes
  • 6.1: Objects and Classes
  • Primitive Variables vs. Objects
  • 6.2: Writing a Simple Class, Step by Step
  • 6.2: Writing a Simple Class, Step by Step
  • Writing the Code for a Class
  • Writing the setLength Method
  • Writing the setWidth Method
  • Writing the getLength and getWidth Methods
  • Writing the getArea Method
  • Accessor and Mutator Methods
  • Showing Access Specification in UML Diagrams
  • JShell Experiment: Writing a Class in JShell
  • 6.3: Instance Fields and Methods
  • 6.3: Instance Fields and Methods
  • 6.4: Constructors
  • 6.4: Constructors
  • Showing Constructors in UML Diagrams
  • Uninitialized Local Reference Variables
  • The Default Constructor
  • The String Class Constructor
  • In the Spotlight: Creating the CellPhone Class
  • In the Spotlight: Simulating Dice with Objects
  • 6.5: Passing Objects as Arguments
  • 6.5: Passing Objects as Arguments
  • In the Spotlight: Simulating the Game of Cho-Han
  • 6.6: Overloading Methods and Constructors
  • 6.6: Overloading Methods and Constructors
  • The BankAccount Class
  • The Contact Class
  • Overloaded Constructors and Methods Make Classes More Useful
  • 6.7: Scope of Instance Fields
  • 6.7: Scope of Instance Fields
  • 6.8: Packages and import Statements
  • 6.8: Packages and import Statements
  • 6.9: Focus on Object-Oriented Design: Finding the Classes and Their Responsibilities
  • 6.9: Focus on Object-Oriented Design: Finding the Classes and Their Responsibilities
  • Identifying a Class's Responsibilities
  • 6.10: Common Errors to Avoid
  • 6.10: Common Errors to Avoid
  • Chapter 6: Review Questions and Exercises
  • Chapter 6: Review Questions and Exercises
  • Chapter 6: Programming Challenges
  • Chapter 6: Programming Challenges
  • 7: Arrays and the ArrayList Class
  • 7: Topics
  • 7.1: Introduction to Arrays
  • 7.1: Introduction to Arrays
  • Accessing Array Elements
  • Inputting and Outputting Array Contents
  • Java Performs Bounds Checking
  • The length Field
  • Array Initialization
  • Alternate Array Declaration Notation
  • JShell Experiment: Working with an Array
  • 7.2: Processing Array Elements
  • 7.2: Processing Array Elements
  • The Enhanced for Loop
  • Letting the User Specify an Array's Size
  • Reassigning Array Reference Variables
  • Copying Arrays
  • 7.3: Passing Arrays as Arguments to Methods
  • 7.3: Passing Arrays as Arguments to Methods
  • 7.4: Some Useful Array Algorithms and Operations Comparing Arrays
  • 7.4: Some Useful Array Algorithms and Operations Comparing Arrays
  • Summing the Values in a Numeric Array
  • Getting the Average of the Values in a Numeric Array
  • Finding the Highest and Lowest Values in a Numeric Array
  • The SalesData Class
  • In the Spotlight: Creating an Object that Processes an Array
  • Partially Filled Arrays
  • Working with Arrays and Files
  • 7.5: Returning Arrays from Methods
  • 7.5: Returning Arrays from Methods
  • 7.6: String Arrays
  • 7.6: String Arrays
  • 7.7: Arrays of Objects
  • 7.7: Arrays of Objects
  • 7.8: The Sequential Search Algorithm
  • 7.8: The Sequential Search Algorithm
  • 7.9: Two-Dimensional Arrays
  • 7.9: Two-Dimensional Arrays
  • Initializing a Two-Dimensional Array
  • The length Field in a Two-Dimensional Array
  • Displaying All the Elements of a Two-Dimensional Array
  • Summing All the Elements of a Two-Dimensional Array
  • Passing Two-Dimensional Arrays to Methods
  • Ragged Arrays
  • 7.10: Arrays with Three or More
  • 7.10: Arrays with Three or More Dimensions
  • 7.11: The Selection Sort and the Binary Search Algorithms
  • 7.11: The Selection Sort and the Binary Search Algorithms
  • The Binary Search Algorithm
  • 7.12: Command-Line Arguments and Variable-Length Argument Lists
  • 7.12: Command-Line Arguments and Variable-Length Argument Lists
  • Variable-Length Argument Lists
  • 7.13: The ArrayList Class
  • 7.13: The ArrayList Class
  • ArrayList Declaration Syntax
  • Using the Enhanced for Loop with an ArrayList
  • The ArrayList Class's toString Method
  • Removing an Item from an ArrayList
  • Inserting an Item
  • Replacing an Item
  • Storing Your Own Objects in an ArrayList
  • 7.14: Common Errors to Avoid
  • 7.14: Common Errors to Avoid
  • Chapter 7: Review Questions and Exercises
  • Chapter 7: Review Questions and Exercises
  • Chapter 7: Programming Challenges
  • Chapter 7: Programming Challenges
  • 8: A Second Look at Classes and Objects
  • 8: Topics
  • 8.1: Static Class Members
  • 8.1: Static Class Members
  • Static Fields
  • Static Methods
  • 8.2: Passing Objects as Arguments to Methods
  • 8.2: Passing Objects as Arguments to Methods
  • 8.3: Returning Objects from Methods
  • 8.3: Returning Objects from Methods
  • 8.4: The toString Method
  • 8.4: The toString Method
  • 8.5: Writing an equals Method
  • 8.5: Writing an equals Method
  • 8.6: Methods That Copy Objects
  • 8.6: Methods That Copy Objects
  • Copy Constructors
  • 8.7: Aggregation
  • 8.7: Aggregation
  • Aggregation in UML Diagrams
  • Security Issues with Aggregate Classes
  • Avoid Using null References
  • Method Chaining
  • 8.8: The this Reference Variable
  • 8.8: The this Reference Variable
  • Using this to Overcome Shadowing
  • Using this to Call an Overloaded Constructor from Another Constructor
  • 8.9: Mutable and Immutable Classes
  • 8.9: Mutable and Immutable Classes
  • Immutable Classes with Mutable Objects as Fields
  • 8.10: Enumerated Types
  • 8.10: Enumerated Types
  • Enumerated Types are Specialized Classes
  • Switching on an Enumerated Type
  • 8.11: Garbage Collection
  • 8.11: Garbage Collection
  • 8.12: Focus on Object-Oriented Design: Class Collaboration
  • 8.12: Focus on Object-Oriented Design: Class Collaboration
  • Determining Class Collaborations with CRC Cards
  • 8.13: Common Errors to Avoid
  • 8.13: Common Errors to Avoid
  • Chapter 8: Review Questions and Exercises
  • Chapter 8: Review Questions and Exercises
  • Chapter 8: Programming Challenges
  • Chapter 8: Programming Challenges
  • 9: Text Processing and More about Wrapper Classes
  • 9: Topics
  • 9.1: Introduction to Wrapper Classes
  • 9.1: Introduction to Wrapper Classes
  • 9.2: Character Testing and Conversion with the Character Class
  • 9.2: Character Testing and Conversion with the Character Class
  • Character Case Conversion
  • JShell Experiment: Testing Character Class Methods
  • 9.3: More String Methods
  • 9.3: More String Methods
  • Searching for Substrings
  • Extracting Substrings
  • Methods that Manipulate a String
  • Calling String Methods on String Literals
  • The Static valueOf Methods
  • JShell Experiment: Testing String Methods
  • 9.4: The StringBuilder Class
  • 9.4: The StringBuilder Class
  • Other StringBuilder Methods
  • In the Spotlight: Formatting and Unformatting Telephone Numbers
  • 9.5: Tokenizing Strings
  • 9.5: Tokenizing Strings
  • 9.6: Wrapper Classes for the Numeric Data Types
  • 9.6: Wrapper Classes for the Numeric Data Types
  • The parse Methods
  • Autoboxing and Unboxing
  • 9.7: Focus on Problem Solving: The TestScoreReader Class
  • 9.7: Focus on Problem Solving: The TestScoreReader Class
  • 9.8: Common Errors to Avoid
  • 9.8: Common Errors to Avoid
  • Chapter 9: Review Questions and Exercises
  • Chapter 9: Review Questions and Exercises
  • Chapter 9: Programming Challenges
  • Chapter 9: Programming Challenges
  • 10: Inheritance
  • 10: Topics
  • 10.1: What Is Inheritance?
  • 10.1: What Is Inheritance?
  • The Superclass’s Constructor
  • 10.2: Calling the Superclass Constructor
  • 10.2: Calling the Superclass Constructor
  • 10.3: Overriding Superclass Methods
  • 10.3: Overriding Superclass Methods
  • Overloading versus Overriding
  • Preventing a Method from Being Overridden
  • 10.4: Protected Members
  • 10.4: Protected Members
  • Package Access
  • 10.5: Chains of Inheritance
  • 10.5: Chains of Inheritance
  • 10.6: The Object Class
  • 10.6: The Object Class
  • 10.7: Polymorphism
  • 10.7: Polymorphism
  • Polymorphism and Dynamic Binding
  • The instance of Operator
  • 10.8: Abstract Classes and Abstract Methods
  • 10.8: Abstract Classes and Abstract Methods
  • 10.9: final Classes and Methods
  • 10.9: final Classes and Methods
  • final Classes and Immutability
  • 10.10: Interfaces
  • 10.10: Interfaces
  • An Interface is a Contract
  • In the Spotlight: Dice, Coins, and the Tossable Interface
  • Fields in Interfaces
  • Implementing Multiple Interfaces
  • Interfaces in UML
  • Default Methods
  • Private Interface Methods
  • Polymorphism and Interfaces
  • Arrays and ArrayLists of Interface References
  • 10.11: Anonymous Inner Classes
  • 10.11: Anonymous Inner Classes
  • 10.12: Functional Interfaces and Lambda Expressions
  • 10.12: Functional Interfaces and Lambda Expressions
  • 10.13: Common Errors to Avoid
  • 10.13: Common Errors to Avoid
  • Chapter 10: Review Questions and Exercises
  • Chapter 10: Review Questions and Exercises
  • Chapter 10: Programming Challenges
  • Chapter 10: Programming Challenges
  • 11: Exceptions and Advanced File I/O
  • 11: Topics
  • 11.1: Handling Exceptions
  • 11.1: Handling Exceptions
  • Handling an Exception with the try Statement
  • When an Exception is Not Caught
  • More About Exception Classes
  • Checked and Unchecked Exceptions
  • Exceptions and Packages
  • Understanding the Stack Trace
  • Retrieving the Default Error Message
  • The Scope of Variables Declared in a try Statement
  • Handling Exceptions Polymorphically
  • Using Multiple catch Clauses to Handle Multiple Exceptions
  • Handling Multiple Exceptions with One catch Clause
  • The finally Clause
  • 11.2: The Extended try-with-resources Statement
  • 11.2: The Extended try-with-resources Statement
  • Handling IOException and its Subclasses
  • Using Exception Handlers to Recover From Errors
  • 11.3: Throwing Exceptions
  • 11.3: Throwing Exceptions
  • Creating Your Own Exception Classes
  • Using the @exception Tag in Documentation Comments
  • 11.4: Advanced Topics: Binary Files, Random Access Files, and Object Serialization
  • 11.4: Advanced Topics: Binary Files, Random Access Files, and Object Serialization
  • Writing Data to a Binary File
  • Reading Data From a Binary File
  • Writing and Reading Strings
  • Appending Data to an Existing Binary File
  • Random Access Files
  • Reading and Writing with the RandomAccessFile Class
  • Object Serialization
  • 11.5: Common Errors to Avoid
  • 11.5: Common Errors to Avoid
  • Chapter 11: Review Questions and Exercises
  • Chapter 11: Review Questions and Exercises
  • Chapter 11: Programming Challenges
  • Chapter 11: Programming Challenges
  • 12: JavaFX: GUI Programming and Basic Controls
  • 12: Topics
  • 12.1: Graphical User Interfaces
  • 12.1: Graphical User Interfaces
  • Event-Driven GUI Programs
  • 12.2: Introduction to JavaFX
  • 12.2: Introduction to JavaFX
  • Controls
  • Stages and Scenes
  • The Application Class
  • 12.3: Creating Scenes
  • 12.3: Creating Scenes
  • Creating Controls
  • Creating Layout Containers
  • Creating a Scene Object
  • Adding the Scene Object to the Stage
  • Setting the Size of the Scene
  • Aligning Controls in an HBox Layout Container
  • 12.4: Displaying Images
  • 12.4: Displaying Images
  • 12.5: More about the HBox, VBox, and GridPane Layout Containers
  • 12.5: More about the HBox, VBox, and GridPane Layout Containers
  • The VBox Layout Container
  • The GridPane Layout Container
  • Using Multiple Layout Containers in the Same Screen
  • 12.6: Button Controls and Events
  • 12.6: Button Controls and Events
  • Handling Events
  • 12.7: Reading Input with TextField Controls
  • 12.7: Reading Input with TextField Controls
  • 12.8: Displaying Alert Dialogs
  • 12.8: Displaying Alert Dialogs
  • The Alert Class and the AlertType Enumeration
  • Determining the Type of Button Clicked on a Confirmation Alert Dialog
  • Modal and Modeless Dialogs
  • Customizing an Alert Dialog
  • 12.9: Using Anonymous Inner Classes and Lambda Expressions to Handle Events
  • 12.9: Using Anonymous Inner Classes and Lambda Expressions to Handle Events
  • Using Lambda Expressions to Create Event Handlers
  • 12.10: The BorderPane Layout Container
  • 12.10: The BorderPane Layout Container
  • 12.11: The ObservableList Interface
  • 12.11: The ObservableList Interface
  • 12.12: Common Errors to Avoid
  • 12.12: Common Errors to Avoid
  • Chapter 12: Review Questions and Exercises
  • Chapter 12: Review Questions and Exercises
  • Chapter 12: Programming Challenges
  • Chapter 12: Programming Challenges
  • 13: JavaFX: Advanced Controls
  • 13: Topics
  • 13.1: Styling JavaFX Applications with CSS
  • 13.1: Styling JavaFX Applications with CSS
  • Type Selector Names
  • Style Properties
  • Applying a Stylesheet to a JavaFX Application
  • Applying Styles to the Root Node
  • Working with Colors
  • Creating a Custom Style Class Name
  • ID Selectors
  • Inline Style Rules
  • 13.2: RadioButton Controls
  • 13.2: RadioButton Controls
  • Determining in Code Whether a RadioButton is Selected
  • Responding to RadioButton Clicks
  • 13.3: CheckBox Controls
  • 13.3: CheckBox Controls
  • Determining in Code Whether a CheckBox is Selected
  • 13.4: ListView Controls
  • 13.4: ListView Controls
  • Retrieving the Selected Item
  • Retrieving the Index of the Selected Item
  • Responding to Item Selection with an Event Handler
  • Adding Items versus Setting Items
  • Initializing a ListView with an Array or an ArrayList
  • Selection Modes
  • Working with the Elements of an ObservableList
  • Using Code to Select an Item in a ListView
  • ListView Orientation
  • Creating ListViews of Objects Other Than String
  • 13.5: ComboBox Controls
  • 13.5: ComboBox Controls
  • Retrieving the Selected Item
  • Responding to ComboBox ItemSelection with an Event Handler
  • Editable ComboBoxes
  • 13.6: Slider Controls
  • 13.6: Slider Controls
  • 13.7: TextArea Controls
  • 13.7: TextArea Controls
  • 13.8: Menus
  • 13.8: Menus
  • 13.9: The FileChooser Class
  • 13.9: The FileChooser Class
  • 13.10 Displaying Multiple Windows
  • 13.10 Displaying Multiple Windows
  • In the Spotlight: The Food Facts Application
  • 13.11: Using Console Output to Debug a GUI Application
  • 13.11: Using Console Output to Debug a GUI Application
  • 13.12: Common Errors to Avoid
  • 13.12: Common Errors to Avoid
  • Chapter 13: Review Questions and Exercises
  • Chapter 13: Review Questions and Exercises
  • Chapter 13: Programming Challenges
  • Chapter 13: Programming Challenges
  • 14: JavaFX: Graphics, Effects, and Media
  • 14: Topics
  • 14.1: Drawing Shapes
  • 14.1: Drawing Shapes
  • The Shape Class and its Subclasses
  • The Line Class
  • Changing the Stroke Color
  • The Circle Class
  • The Rectangle Class
  • The Ellipse Class
  • The Arc Class
  • The Polygon Class
  • The Polyline Class
  • The Text Class
  • Rotating Nodes
  • Scaling Nodes
  • 14.2: Animation
  • 14.2: Animation
  • The TranslateTransition Class
  • The RotateTransition Class
  • The ScaleTransition Class
  • The StrokeTransition Class
  • The FillTransition Class
  • The FadeTransition Class
  • Controlling the Animation
  • 14.3: Effects
  • 14.3: Effects
  • The DropShadow Class
  • The InnerShadow Class
  • The ColorAdjust Class
  • The BoxBlur, GaussianBlur, and MotionBlur Classes
  • The SepiaTone Class
  • The Glow Class
  • The Reflection Class
  • Combining Effects
  • 14.4: Playing Sound Files
  • 14.4: Playing Sound Files
  • 14.5: Playing Videos
  • 14.5: Playing Videos
  • 14.6: Handling Key Events
  • 14.6: Handling Key Events
  • 14.7: Handling Mouse Events
  • 14.7: Handling Mouse Events
  • 14.8: Common Errors to Avoid
  • 14.8: Common Errors to Avoid
  • Chapter 14: Review Questions and Exercises
  • Chapter 14: Review Questions and Exercises
  • Chapter 14: Programming Challenges
  • Chapter 14: Programming Challenges
  • 15: Recursion
  • 15: Topics
  • 15.1: Introduction to Recursion
  • 15.1: Introduction to Recursion
  • 15.2: Solving Problems with Recursion
  • 15.2: Solving Problems with Recursion
  • 15.3: Examples of Recursive Methods
  • 15.3: Examples of Recursive Methods
  • Drawing Concentric Circles
  • The Fibonacci Series
  • Finding the Greatest Common Divisor
  • 15.4: A Recursive Binary Search Method
  • 15.4: A Recursive Binary Search Method
  • 15.5: The Towers of Hanoi
  • 15.5: The Towers of Hanoi
  • 15.6: Common Errors to Avoid
  • 15.6: Common Errors to Avoid
  • Chapter 15: Review Questions and Exercises
  • Chapter 15: Review Questions and Exercises
  • Chapter 15: Programming Challenges
  • Chapter 15: Programming Challenges
  • 16: Databases
  • 16: Topics
  • 16.1: Introduction to Database Management Systems
  • 16.1: Introduction to Database Management Systems
  • Creating the CoffeeDB Database
  • 16.2: Tables, Rows, and Columns
  • 16.2: Tables, Rows, and Columns
  • 16.3: Introduction to the SQL SELECT Statement
  • 16.3: Introduction to the SQL SELECT Statement
  • The ResultSet Object
  • More About the SELECT Statement
  • Specifying Search Criteria with the WHERE Clause
  • Sorting the Results of a SELECT Query
  • Mathematical Functions
  • 16.4: Parameterized Queries
  • 16.4: Parameterized Queries
  • Using LIKE and Wildcard Characters in Parameterized Queries
  • 16.5: Inserting Rows
  • 16.5: Inserting Rows
  • Inserting Rows with JDBC
  • Parameterized INSERT Statements
  • 16.6: Updating and Deleting Existing Rows
  • 16.6: Updating and Deleting Existing Rows
  • Parameterized UPDATE Statements
  • Deleting Rows with the DELETE Statement
  • Parameterized DELETE Statements
  • 16.7: Creating and Deleting Tables
  • 16.7: Creating and Deleting Tables
  • Creating Tables with JDBC
  • Removing a Table with the DROP TABLE Statement
  • 16.8: Creating a New Database with JDBC
  • 16.8: Creating a New Database with JDBC
  • 16.9: Scrollable Result Sets
  • 16.9: Scrollable Result Sets
  • 16.10: Result Set Metadata
  • 16.10: Result Set Metadata
  • 16.11: Relational Data
  • 16.11: Relational Data
  • Joining Data From Multiple Tables
  • An Order Entry System
  • 16.12: Advanced Topics
  • 16.12: Advanced Topics
  • Stored Procedures
  • 16.13: Common Errors to Avoid
  • 16.13: Common Errors to Avoid
  • Chapter 16: Review Questions and Exercises
  • Chapter 16: Review Questions and Exercises
  • Chapter 16: Programming Challenges
  • Chapter 16: Programming Challenges
  • Glossary
  • Credits
  • Credits
  • Index
  • Footnotes