Internet Java(TM) Applications Copyright 2001 Art Gittleman Table of Contents: 1. Preliminaries 1. Exception Handling Exception Classes The Array Index Out of Bounds Exception The Number Format Exception 2. Input and Output The File Class Reading and Writing Bytes Reading and Writing Primitive Types Reading and Writing Text Random Access Files Reading and Writing Objects 3. Event-Driven Programming The Java Event Model Four Types of Adapters Window Events 4. Introduction to Threads The Thread Class The Runnable Interface 5. Concurrent Programming An Example without Synchronization Synchronization Communication Deadlock 6. GridBag Layout Default GridBag Constraints Setting Weight and Fill Anchoring and Internal Padding Insets Positioning Constraints The Form Applet 7. Vectors and Enumerations 2. Networking 1. Using a URL to Connect The Uniform Resource Locator (URL) Connecting from an Applet Connecting from a Standalone Application 2. Protocols with a URLConnection The Hypertext Transfer Protocol (HTTP) Using a URL Connection 3. Clients and Servers Using Sockets Server Ports A Client-Server Example A Request Header Server 4. Browsers and Web Servers A Very Simple Browser A Very Simple Web Server A Threaded Web Server 5. Remote Method Invocation (RMI) Distributed Computing: The RMI Solution The Interface The Server The Client 3. Java Database Connectivity (JDBC) 1. Database Tables and SQL Queries Relational Database Tables Structured Query Language 2. Connecting to a Database Database and Application Servers A JDBC Drver Creating an ODBC Source Connecting from Java Building the Database 3. Retrieving Information Viewing Query Results SELECT Statement Options 4. Metadata and Aggregate Functions Database Metadata Result Set Metadata Aggregate Functions 5. Prepared Statements and Transactions Using Prepared Statements Transaction Processing 6. A GUI for Database Queries The List Component 4. Servlets and JavaServer Pages 1. A First Servlet Servlets with the JSWDK or JRun Generic Servlets Using the Web Server 2. HTML forms Get Requests Post Requests 3. Server Side Includes and Servlet Chaining Server-Side Includes Servlet Chaining 4. Three-tier Architectures Using a Database in a Three-tiered Architecture 5. Session-Tracking 6. JavaServer Pages Getting Started with JSP A JSP Response to a Form JSP and JavaBeans Components 5. Swing 1. Getting Started with Swing The Swing Classes Converting an AWT Applet to Swing Text Components and Labels A Swing Application with Look and Feel Demo 2. Images, Buttons, and Borders Images Buttons Borders Automatic Double Buffering 3. Lists and Toggle Buttons Lists Checkboxes Scroll Panes Radio Buttons Combo Boxes 4. Menus and Dialogs Menus Dialogs 5. Tabs and Tables Tabbed Panes Tables 6. Java2D 1. Geometry Points Shapes Rectangular Shapes Combining Shapes 2. Rendering Transformations Painting Stroking Clipping 3. Text Attributes Painting and Transforming 4. Printing Graphics Printing a File 7. Internationalization 1. Locales and Encodings Locales Encodings 2. Number, Currency, Percent, Date, and Time Formatting Numbers Dates 3. Collation 4. Localizing User Interfaces Property Files Property Classes 5. Message Formatting 8. Multimedia 1. Animation Double Buffering Animating Text Using Multiple Images 2. Sound 3. The Java Media Framework 4. Java 3D Basics A Scene Graph A Cube Transforms Shapes Colors 5. Java 3D Light, Motion, and Texture Light Motion Texture 9. Java Beans 1. Building with Beans Starting the BeanBox Building an Applet with Beans 2. Bound and Constrained Properties Simple Properties Bound Properties Constrained Properties 3. Writing and Packaging a Bean A Simple Bean JAR Files A Bean with a Bound Property Smiley Bean Anonymous Inner Classes 4. Using BeanInfo What is BeanInfo? Friendly Bean BeanInfo for Friendly Packaging Friendly 5. Programming with Beans Using Beans in an Applet Customizing Beans 10. Enterprise JavaBeans 1. Getting Started with EJB The J2EE Architecture A J2EE Server Hello Bean The Hello Application Deploying the Hello Application 2. Entity Beans The Remote Interface The Home Interface The Entity Bean (Container-Managed) Transactions Deploying an Entity Bean A Customer Client 3. Session Beans A Stateful Session Bean Deploying the Agent Bean A Sales Client 4. Servlet and JSP Clients A Servlet Client A JSP Client 11. Collections 1. The Collection Interfaces and Classes The Collections Interfaces Sets Iterators 2. Lists Implementations 3. Maps Implementations 4. Comparisons and Ordering Inheriting from Object Overriding Object Methods The Comparable Interface Sorted Sets and Maps 5. Algorithms 12. Security and the Java Virtual Machine 1. Using a Security Manager Properties The Security Manager The Java Plug-in 2. Policies and Permissions Policy Files Codebase Permissions Digital Signatures 3. The Java VirtuaL Machine 4. The Structure of a Class File Using a Disassembler Reading the Class File Appendices A. Mouse and Key Events B. The ASCII Character Set C. Some HTML Tags