table of contents

Java 5 & Java 6

Tutorials and Training Materials

The tutorials were originally based on the second edition of Marty's book Core Web Programming, and then updated based on new features in Java 5 and 6 and in his live training courses. Marty's materials and courses have been given in the US, Canada, Australia, Puerto Rico, Japan, Mexico, and the Philippines, and are continually being revised. Also see the J2EE training materials home page for beginning/intermediate servlet and JSP tutorials, advanced servlet and JSP tutorials, Jakarta Struts tutorials, Apache Tomcat tutorials, JSF tutorials, and tutorials in Chinese and Japanese.

The PDF versions of the tutorials are freely available to anyone for personal use. These versions contain the complete text of the PowerPoint slides, and are what you want if your goal is to learn or review the technology. As a courtesy, coreservlets.com also makes the original PowerPoint slides available to faculty teaching courses that do not compete with Marty's live courses. See the J2EE instructor materials page for details.

To arrange a Java 5 or J2EE training course at your organization based on any of the materials, contact info@coreservlets.com. These courses can be customized to use any combination of the materials on the J2EE tutorials site, and new materials can be added for specific client needs. To learn more details about the instructor, the curriculum for the live training courses, or the public course schedule, please see http://courses.coreservlets.com.

Source Code

Source code for all examples in these tutorials can be downloaded from the Java 5 source code repository.


A Fast Introduction to HTML

View PDF of Introduction to HTML
Free for personal use.

This is not a Java topic, but useful for Java programmers


Introduction to HTML Frames

View PDF of Introduction to HTML Frames
Free for personal use.

This is not a Java topic, but useful for Java programmers


Introduction to and Overview of Java

View PDF of Introduction to Java
Free for personal use.

This is the first real Java 5 topic.

Topics:

  • Truths / Myths About Java
  • Common Java Protocols and Packages
  • Getting Started

Basic Java Syntax

View PDF of Basic Java Syntax
Free for personal use.

Topics:

  • Creating, compiling, and executing simple Java programs
  • Accessing arrays
  • Looping
  • Indenting code
  • Using if statements
  • Comparing strings
  • Building arrays
  • Performing basic mathematical operations
  • Reading command-line input

Basic Object-Oriented Programming in Java

View PDF of Basic Object-Oriented Programming in Java
Free for personal use.

Topics:

  • Similarities and differences between Java and C++
  • Object-oriented nomenclature and conventions
  • Instance variables (data members, fields)
  • Methods (member functions)
  • Constructors

Object-Oriented Programming in Java: More Capabilities

View PDF of More Object-Oriented Programming in Java
Free for personal use.

Topics:

  • Overloading
  • Designing "real" classes
    • Encapsulation and accessor methods
    • JavaDoc
  • Inheritance
  • Quick intro to advanced topics
    • Abstract classes
    • Interfaces
    • Understanding polymorphism
    • Setting CLASSPATH and using packages
    • Visibility modifiers

Applets and Basic Graphics

View PDF of Applets and Basic Graphics
Free for personal use.

Topics:

  • Applet restrictions
  • Basic applet and HTML template
  • The applet life-cycle
  • Customizing applets through HTML parameters
  • Methods available for graphical operations
  • Loading and drawing images
  • Controlling image loading

More Java Syntax and Utilities

View PDF of More Java Syntax and Utilities
Free for personal use.

Topics:

  • Mutating vs. returning results
  • Data structures
    • ArrayList
    • LinkedList
    • HashMap
  • Generics
  • printf
  • varargs
  • String vs. StringBuilder

Asynchronous Event Handling

View PDF of Asynchronous Event Handling.
Free for personal use.

Topics:

  • General event-handling strategy
  • Handling events with separate listeners
  • Handling events by implementing interfaces
  • Handling events with named inner classes
  • Handling events with anonymous inner classes
  • The standard AWT listener types
  • Subtleties with mouse events

Java Web Start and Deployment Options

View PDF of Java Web Start and Deployment Options.
Free for personal use.

Topics:

  • Individual .class files
  • JAR files
  • OS wrapper around class files or JAR files
  • Applets
  • Java Web Start
  • Server-based Alternatives

AWT Components

View PDF of AWT Components
Free for personal use.

Topics:

  • Basic AWT windows
  • Creating lightweight components
  • Closing frames
  • Using object serialization to save components to disk
  • Basic AWT user interface controls
  • Processing events in GUI controls

Layout Managers

View PDF of Layout Managers
Free for personal use.

Topics:

  • How layout managers simplify interface design
  • Standard layout managers
  • Positioning components manually
  • Strategies for using layout managers effectively

Java 2D

View PDF of Java 2D
Free for personal use.

Topics:

  • Drawing Shapes
  • Paint Styles
  • Transparency
  • Using Local Fonts
  • Stroke Styles
  • Coordinate Transformations
  • Requesting Drawing Accuracy

Basic Swing

View PDF of Basic Swing
Free for personal use.

Topics:

  • New features
  • Basic approach
  • Starting points
  • Swing equivalent of AWT components
  • New Swing components
  • Other simple components

Advanced Swing and MVC

View PDF of Advanced Swing and MVC
Free for personal use.

Topics:

  • Building a simple static JList
  • Adding and removing entries from a JList at runtime
  • Making a custom data model
  • Making a custom cell renderer

Multithreaded Programming

View PDF of Multithreaded Programming
Free for personal use.

Topics:

  • Why threads?
  • Approaches for starting threads
  • Solving common thread problems
  • Synchronizing access to shared resources
  • Thread life cycle
  • Stopping threads

Multithreaded Graphics and Animation

View PDF of Multithreaded Graphics and Animation
Free for personal use.

Topics:

  • Approaches for multithreaded graphics
  • Reducing flicker in animations
  • Implementing double buffering
  • Animating images
  • Controlling timers

Network Programming - Clients

View PDF of Network Programming - Clients
Free for personal use.

Topics:

  • Creating sockets
  • Implementing a generic network client
  • Parsing data
  • Retrieving files from an HTTP server
  • Retrieving Web documents by using the URL class

Network Programming - Servers

View PDF of Network Programming - Servers
Free for personal use.

Topics:

  • Steps for creating a server
  • A generic network server
  • Accepting connections from browsers
  • Creating an HTTP server
  • Adding multithreading to an HTTP server

Servers and Forms

View PDF of Servers and Forms
Free for personal use.

Note: this is a preview of the tutorials on servlets and JSP.

Topics:

  • Sending data from forms
  • The FORM element
  • Text controls
  • Push buttons
  • Check boxes and radio buttons
  • Combo boxes and list boxes
  • File upload controls
  • Server-side image maps
  • Hidden fields
  • Grouping controls
  • Tab ordering

Servers and Applets

View PDF of Servers and Applets
Free for personal use.

Note: this is a preview of the tutorials on servlets and JSP.

Topics:

  • Sending GET data and having the browser display the results
  • Sending GET data and processing the results within the applet (HTTP tunneling)
  • Using object serialization to exchange high-level data structures between applets and servlets
  • Sending POST data and processing the results within the applet (HTTP tunneling)
  • Bypassing the HTTP server altogether

XML Parsing and DOM

View PDF of XML Parsing and DOM
Free for personal use.

Topics:

  • Options for input files
  • XML overview
  • Comparing XML with HTML
  • Parsing an XML document
  • Extracting data from parsed Document
  • Specifying grammars

Invoking OS-Specific Programs and Native Methods

View PDF of Invoking OS-Specific Programs and Native Methods
Free for personal use.

Topics:

  • Integration options
  • Invoking native programs
  • Calling native functions

New Features in JDK 1.5

View PDF of New Features in JDK 1.5
Free for personal use.

This section has no material not covered earlier, but if you know Java 1.4 and haven't seen Java 5 yet, this section gives a very quick intro to the most important new Java 5 features.


Sample Exercises

View PDF of Java 5 Sample Exercises
Free for personal use.

The the live training courses are in lecture/lab format, and these are a sample of the exercises. There is one set of exercises for each topic of the tutorials, and the exercises are meant to illustrate the most important techniques of that topic. You will learn a lot more by doing exercises in conjunction with reading the tutorials than by reading alone. Try them!

Note: code for the solutions can be found here.


More Information

Online documentation