Book Description

About the Author

Table of Contents

Source Code

Errata

Send Comments

Teaching Materials

Author's Homepage
 

Object-Oriented Software Development Using Java
Xiaoping Jia, Ph.D
Chapter 8: Object-Oriented Application Frameworks 

Contents
   8.1 Application Frameworks
         8.1.1 Characteristics
         8.1.2 Design Requirements
         8.1.3 Specific Frameworks Considered
   8.2 The Collections Framework
         8.2.1 Abstract Collections
         8.2.2 Interfaces of Collections
         8.2.3 Implementations of Collections
         8.2.4 Iterators of Collections
         8.2.5 Ordering and Sorting
   8.3 The Graphical User Interface Framework AWT and Swing
         8.3.1 The GUI Components
         8.3.2 Design Pattern: Composite
         8.3.3 Layout Managers
         8.3.4 Handling Events
         8.3.5 Frames and Dialogs
   8.4 The Input/Output Framework
         8.4.1 Byte Streams
         8.4.2 Design Pattern: Decorator
         8.4.3 Character Streams
         8.4.4 Random Access Files



Other Chapters

  • Example 8.1 Count the Number of DifferentWords
  • Example 8.2 Count the Number of Occurrences of EachWord
  • Example 8.3 List word count in alphabetical order
  • Example 8.4 List word count in reverse alphabetical order
  • Example 8.5 List word count in the order of frequency
  • Example 8.14 Using Basic Byte I/O Streams
    • Source code: WriteMatrix1.java
    • Source code: ReadMatrix1.java
    • Compile:
      • javac WriteMatrix1.java
        javac ReadMatrix1.java
    • Run:
      • java WriteMatrix1 mat1.dat
        java ReadMatrix1 mat1.dat
  • Example 8.15 The "WriteMatrix2/ReadMatrix2" Application
    • Source code: WriteMatrix2.java
    • Source code: ReadMatrix2.java
    • Compile:
      • javac WriteMatrix2.java
        javac ReadMatrix2.java
    • Run:
      • java WriteMatrix2 mat2.dat
        java ReadMatrix2 mat2.dat
  • Example 8.16 Using Buffered I/O Streams
    • Source code: WriteMatrix3.java
    • Source code: ReadMatrix3.java
    • Compile:
      • javac WriteMatrix3.java
        javac ReadMatrix3.java
    • Run:
      • java WriteMatrix3 mat3.dat
        java ReadMatrix3 mat3.dat
  • Example 8.17 Using Object Serialization
    • Source code: WriteMatrix4.java
    • Source code: ReadMatrix4.java
    • Compile:
      • javac WriteMatrix4.java
        javac ReadMatrix4.java
    • Run:
      • java WriteMatrix4 mat4.dat
        java ReadMatrix4 mat4.dat
  • Example 8.18 Using Character Streams
    • Source code: WriteMatrix5.java
    • Source code: ReadMatrix5.java
    • Compile:
      • javac WriteMatrix5.java
        javac ReadMatrix5.java
    • Run:
      • java WriteMatrix5 mat5.dat
        java ReadMatrix5 mat5.dat
  • Example 8.19 A Universal Text Viewer
    • Source code: UniversalTextViewer.java
    • Test data: Dreams in Red Masions, Chapter One, ISO-GB2312 encoding (hlmg0001.gb)
    • Compile:
      • javac UniversalTextViewer.java
    • Run:
      • java UniversalTextViewer hlmg001.gb GB2312
    • Installing fonts. To view text in a language that is different from the language supported by your operating system, additional fonts must be installed and configured. This  process is operating system specific and language specific. Detail instructions are available from Sun. The following instructions are specific to viewing simplified Chinese (ISO-GB2312) on Microsoft Windows 95/98/NT/2000/XP for US-English with JDK standard dsitribution for US-English.
      • Microsoft Internet Explorer multi-lingual package includes two TrueType fonts for simplified Chinese, MS Song and MS Hei. Both fonts are in Unicode encoding. Install these fonts.
      • Locate the font.properties file in JDK. It should be in 
           
          C:/j2sdk1.4.x/jre/lib/
        Rename this file to a different name. Rename the file font.properties.zh to font.properties.
      • Edit the font.properties. 
        • In the lines that begin with monospaced, change the font name \u5b8b\u4f53 to MS Song
        • Comment out the two lines that begin with 

        • fontcharset.monospaced.0
          fontcharset.monospaced.1
           

        The relevant lines in font.properties should look like this. You are all set.
  • Example 8.20 Store Serialized Objects in Random Access Files
    • Source code: ObjectRandomAccessFile.java
    • Source code: TestWrite.java
    • Source code: TestRead.java
    • Compile:
      • javac ObjectRandomAccessFile.java
        javac TestWrite.java
        javac TestRead.java
    • Test write objects:
      • java TestWrite obj.dat
    • Test read objects:
      • java TestRead obj.dat 0 14 28

Book Description - About the Author - Table of Contents
Source Code - Errata - Send Comments
Teaching Materials - Author's Homepage