JAVA. EXAMPLES IN A NUTSHELL. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo. Third Edition.



Similar documents
JAVA ENTERPRISE IN A NUTSHELL. Jim Farley and William Crawford. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo.

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

JAVA r VOLUME II-ADVANCED FEATURES. e^i v it;

JAVA IN A NUTSHELL O'REILLY. David Flanagan. Fifth Edition. Beijing Cambridge Farnham Köln Sebastopol Tokyo

Java the UML Way: Integrating Object-Oriented Design and Programming

PYTHON IN A NUTSHELL. O'REILLY Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo. Alex Martelli. Second Edition

C#5.0 IN A NUTSHELL. Joseph O'REILLY. Albahari and Ben Albahari. Fifth Edition. Tokyo. Sebastopol. Beijing. Cambridge. Koln.

C# Cookbook. Stephen Teilhet andjay Hilyard. O'REILLY 8 Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo '"J""'

Windows PowerShell Cookbook

Java SE 7 Programming

How To Write A Nosql Database In Spring Data Project

Learning Web App Development

Programming Flash Communication Server

IT6503 WEB PROGRAMMING. Unit-I

Japan Communication India Skill Development Center

Building Web Applications, Servlets, JSP and JDBC

Learning Web Design. Third Edition. A Beginner's Guide to (X)HTML, Style Sheets, and Web Graphics. Jennifer Niederst Robbins

Glassfish, JAVA EE, Servlets, JSP, EJB

App Inventor Create Your Own Android Apps

An Overview of Java. overview-1

Web Development in Java

Patterns of Enterprise Application Architecture

High Performance XML Data Retrieval

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Dreamweaver CS3 THE MISSING MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Japan Communication India Skill Development Center

Applets, RMI, JDBC Exam Review

FIFTH EDITION. Oracle Essentials. Rick Greenwald, Robert Stackowiak, and. Jonathan Stern O'REILLY" Tokyo. Koln Sebastopol. Cambridge Farnham.

Java SE 7 Programming

Java EE Web Development Course Program

Java SE 7 Programming

Course Number: IAC-SOFT-WDAD Web Design and Application Development

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

Rails Cookbook. Rob Orsini. O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Japan Communication India Skill Development Center

Efficiency of Web Based SAX XML Distributed Processing

Java Application Developer Certificate Program Competencies

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

Implementing Mobile Thin client Architecture For Enterprise Application

Complete Java Web Development

BHARATHIAR UNIVERSITY COIMBATORE SCHOOL OF DISTANCE EDUCATION

Oracle PL/SQL Programming

Detailed Table of Contents

Fundamentals of Java Programming

Communiqué 4. Standardized Global Content Management. Designed for World s Leading Enterprises. Industry Leading Products & Platform

CaptainCasa. CaptainCasa Enterprise Client. CaptainCasa Enterprise Client. Feature Overview

Introduction to Sun ONE Application Server 7

Java (12 Weeks) Introduction to Java Programming Language

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Specialized Programme on Web Application Development using Open Source Tools

Building and Using Web Services With JDeveloper 11g

Hadoop: The Definitive Guide

Java Web Services Developer Pack. Copyright 2003 David A. Wilson. All rights reserved.

ICE Trade Vault. Public User & Technology Guide June 6, 2014

NETWORK SECURITY HACKS *

DIABLO VALLEY COLLEGE CATALOG

Web Security, Privacy, and Commerce

Enterprise Java. Where, How, When (and When Not) to Apply Java in Client/Server Business Environments. Jeffrey Savit Sean Wilcox Bhuvana Jayaraman

10CS73:Web Programming

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

sendmail Cookbook Craig Hunt O'REILLY' Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Hadoop: The Definitive Guide

WebSphere Training Outline

Java Power Tools. John Ferguson Smart. ULB Darmstadt 1 PI. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

For Course Details, visit:

NASA Workflow Tool. User Guide. September 29, 2010

JavaScript Patterns. Stoyan Stefanov. O'REILLY' Beijing Cambridge Farnham Koln Sebastopol Tokyo

Japan Communication India Skill Development Center

Practical Android Projects Lucas Jordan Pieter Greyling

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat

NetBeans IDE Field Guide

Core Java+ J2EE+Struts+Hibernate+Spring

Extreme Java G Session 3 Main Theme Java Core Technologies (Part I) Dr. Jean-Claude Franchitti

Net-WMS FP Net-WMS SPECIFIC TARGETED RESEARCH OR INNOVATION PROJECT. Networked Businesses. D.8.1 Networked architecture J2EE compliant

COMMUNITY COLLEGE OF CITY UNIVERSITY CITY UNIVERSITY OF HONG KONG

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

Web-JISIS Reference Manual

Web Security Testing Cookbook*

NETWORK SECURITY HACKS

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

Computing Concepts with Java Essentials

Specialized Programme on Web Application Development using Open Source Tools

Enterprise JavaBeans 3.1

Monitoring Infrastructure (MIS) Software Architecture Document. Version 1.1

XML Processing and Web Services. Chapter 17

Mobile Application Languages XML, Java, J2ME and JavaCard Lesson 04 Java

Course Name: Course in JSP Course Code: P5

SE 450 Object-Oriented Software Development. Requirements. Topics. Textbooks. Prerequisite: CSC 416

DIPLOMADO DE JAVA - OCA

A Java proxy for MS SQL Server Reporting Services

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

VIRTUAL LABORATORY: MULTI-STYLE CODE EDITOR

A Tool for Evaluation and Optimization of Web Application Performance

Mastering Tomcat Development

Developing Java Web Services

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

Java 2 Platform, Enterprise Edition (J2EE): Enabling Technologies for EAI

Tutorial: Building a Web Application with Struts

Transcription:

"( JAVA. EXAMPLES IN A NUTSHELL Third Edition David Flanagan O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Table of Contents Preface xi Parti. Learning Java 1. Java Basics 3 Hello World 3 FizzBuzz 7 The Fibonacci Series 9 Using Command-Line Arguments 10 Echo in Reverse 11 FizzBuzz Switched 12 Computing Factorials 13 Recursive Factorials 14 Caching Factorials 14 Computing Big Factorials 16 Handling Exceptions 17 Interactive Input 18 Using a StringBuffer 19 Sorting Numbers 21 Computing Primes 22 2. Objects, Classes, and Interfaces 24 A Rectangle Class 25 Testing the Rect Class 26 A Rect Subclass 27 Another Subclass 28

Complex Numbers 29 Computing Statistics 31 An Integer List 33 Tokenizing Text 37 Part II. Core Java APIs 3. Input/Output 59 Files and Streams 59 Working with Files 62 Copying File Contents 63 Reading and Displaying Text Files 66 Listing Directory and File Information 70 Compressing Files and Directories 75 Filtering Character Streams 77 Tokenizing a Character St ream. 79 Random Access to Files 81 4. Threads 85 Thread Basics 86 Thread-Safe Classes.. 88 Threads and Thread Groups 90 Deadlock 92 Timers 94 5. Networking 102 Downloading the Contends of a URL 102 Using a URLConnection 104 Sending Email Through a URLConnection 105 A Simple Network Client 107 A Generic Client. 109 An HTTP Client 112 A POP Client 115 A Simple Web Server 121 A Proxy Server 123 A Generic Multithreaded Server 126 Sending Datagrams 139 Receiving Datagrams 141 6. New 1/0 144 Locking Files 146 Table of Contents

Copying Files 148 Regular Expressions and Character Decoding 150 File Copying with Buffers 153 Advanced Byte-to-Character Conversion 155 Tokenizing Byte Buffers 157 A Simple HTTP Client 162 The Daytime Service 166 A Multiplexed Server 172 A Multiplexed Network Client 175 7. Security and Cryptography 187 Running Untrusted Code 188 Loading Untrusted Code 189 Message Digests and Digital Signatures 194 Cryptography 203 8. Internationalization 208 A Word 1 About Locales 208 Unicode 209 Character Encodings 214 Handling Local Customs 215 Localizing User-Visible Messages 220 Formatted Messages 225 9. Reflection 230 Obtaining Class and Member Information 230 Invoking a Named Method 233 Proxy Objects 238 10. Object Serialization 241 Simple Serialization 241 Custom Serialization 245 Externalizable Classes 247 Serialization and Class Versioning 249 Part III. Desktop Java APIs 11. Graphical User Interfaces 255 Components 257 Containers 259 Layout Management 260 Table of Contents I vii

Event Handling. 274 A Complete GUI. 291 Actions and Reflection 295 Custom Dialogs.. 297 An Error Handler Dialog 302 Displaying Tables 308 Displaying Trees. 311 A Simple Web Browser 315 Describing GUIs with Properties 324 Themes and the Metal Look-and-Feel 336 Look-and-Feel Preferences 341 The ShowBean Program 344 12. Graphics 353 Graphics Before Java 1.2. 354 The Java 2D API 363 Drawing and Filling Shapes 365 Transforms ' 367 Line Styles with BasicStroke 369 Stroking Lines 371 Filling Shapes with Paint ' 372. \ Antialiasing 376 Combining Colors with AlphaComposite...: 377 Image Processing 381 Image I/O. 385 Custom Shapes 387 Custom Strokes 396 Custom Paint ' 400 Advanced Animation 402 Displaying Graphics Examples 405 13. Printing 411 Printing with the Java 1.1 API 412 Printing with the Java 1.2 API 416 Printing with the Java 1.4 API 419 Printing Multipage Text Documents 422 Advanced Printing with Java 1.4 ' 431 14. Data/Transfer 438 Simple Swing Data Transfer 438 A Clock with Drag and Copy Support 440 viii Table of Contents

Data Transfer Architecture 443 Dropping Multiple Datatypes 443 A Transferable Shape '_, 447 Custom Data Transfer 447 15. JavaBeans 456 Bean Basics <. 457 T A Simple Bean 458 A More Complex Bean : 462 Custom Events 467 Specifying Bean Information. ; 468 ; Defining a Simple Property Editor 470 Defining a Complex Property Editor, 473 Defining a Bean Customizer 474 Manipulating Beans. 477 16. Applets 487 Introduction to Applets 488.; A First Applet. 489. A Clock Applet, 490 A Timer Applet 493... Applets and the Java 1.0 Event Model.. 497,17. Sound 501 ; Ringing the Bell 502 Swing Aural Cues 503 Playing Sounds with AudioClip. 503. Playing Sounds with javax.sound 504 Streaming Sounds with javax.sound 512 Synthesizing a MIDI Sequence 515 -. Real-Time MIDI Sounds 520 Part IV. Enterprise Java APIs 18. Database Access with SQL. : ; 525 Accessing a Database 526 Using Database Metadata 533 Building a Database 536 Using the API Database 541 Atomic Transactions 546 Table of Contents

19. XML Parsing with JAXP and SAX Parsing and Manipulating with JAXP and DOM Transforming XML with XSLT An XML Pull Parser 20. Servlets and JavaServer Pages Servlet Setup A Hello World Servlet Another Simple Servlet Servlet Initialization and Persistence: A Counter Servlet Hello JSP Hello JSP2 Hello XML The MVC Paradigm for Web Applications ListManager Model Classes ListManager Controller ListManager Views ' Custom Tags in JSP 2.0 Packaging a Web Application 21. Remote Method Invocation Remote Banking A Bank Server A Persistent Bank Server A Multiuser Domain Remote MUD Interfaces The MUD Server The MudPlace Class The MudPerson Class A MUD Client Advanced RM1 22. Example Index Index 547 547 552 556 557 569 570 573 575 576 581 583 585 586 586 590 595 598 600 605 606 610 614 621 622 625 628 637 638 647 650 675 x I Table of Contents