Appendix A

The Jawa API Quick Reference


CONTENTS


This appendix summarizes the classes and interfaces of the Java API. The eight packages of the Java API are presented in alphabetical order.

java.applet

The java.applet package provides the Applet class and the interfaces needed to support Java applets. It consists of a single Applet class and three interfaces that enable audio playing and applet integration within browsers.

Classes

Applet

The Applet class is a subclass of the java.awt.Panel class that is used to implement Java applets.

Interfaces

AppletContext

The AppletContext interface provides methods that allow an applet to interact with the context in which it is run, such as a browser, the applet viewer, or an application program.

AppletStub

The AppletStub interface provides methods that are used to implement programs that display an applet.

AudioClip

The AudioClip interface provides methods that are used to implement classes that support the playing of audio clips within applets.

java.awt

The java.awt package provides the classes that support Java window programming. This package is known as the Abstract Windowing Toolkit.

Classes

BorderLayout

The BorderLayout class is used to lay out the GUI objects contained within a Container object. It is the default layout for Window, Frame, and Dialog objects.

Button

The Button class implements a clickable button GUI control.

Canvas

The Canvas class implements a GUI object that supports drawing. Drawing is not implemented on the canvas itself, but on the Graphics object provided by the canvas.

CardLayout

The CardLayout class is used to lay out the objects in a Container object in the form similar to a deck of cards.

Checkbox

The Checkbox class is used to implement checkbox and radio button GUI controls.

CheckboxGroup

The CheckboxGroup class is used with the Checkbox class to implement radio buttons.

CheckboxMenuItem

The CheckboxMenuItem class is used to implement menu items that can be checked on or off.

Choice

The Choice class is used to implement pull-down lists that can be placed within the main area of a window.

Color

The Color class provides a system-independent color implementation and defines several color constants.

Component

The Component class is the superclass of all window GUI controls. It provides a common set of methods that support component organization, display, and event handling.

Container

The Container class is the superclass of window classes that contain other objects and provides a common set of methods to organize and display contained objects.

Dialog

The Dialog class is used to implement dialog box windows.

Dimension

The Dimension class is used to represent the width and height of a two-dimensional object.

Event

The Event class is used to encapsulate all events processed by Java window programs.

FileDialog

The FileDialog class is used to construct dialog boxes that support the selection of files for input and output operations.

FlowLayout

The FlowLayout class is used to lay out window Container objects. It is the default layout used with the Panel class.

Font

The Font class implements a system-independent set of fonts that control text display.

FontMetrics

The FontMetrics class is used to access the specific display properties of a Font class.

Frame

The Frame class is used to create and control the main application window of standalone Java window programs.

Graphics

The Graphics class supports the drawing of graphical objects and text within a window.

GridBagConstraints

The GridBagConstraints class is used to identify the positioning parameters of a component that is contained within an object that is laid out using the GridBagLayout class.

GridBagLayout

The GridBagLayout class allows a Container object to be laid out in a gridlike fashion with component objects occupying more than one row or column.

GridLayout

The GridLayout class is used to lay out a Container object in a grid where all elements of the grid are the same size.

Image

The Image class provides a content-independent mechanism for implementing graphical images.

Insets

The Insets class is used to specify the margins associated with a GUI object.

Label

The Label class is used to display text labels within a window or other GUI container.

List

The List class implements single- and multiple-selection list GUI controls.

MediaTracker

The MediaTracker class provides a set of methods for managing images used to implement multimedia objects.

Menu

The Menu class implements a single pull-down menu that is attached to a menu bar or other menu.

MenuBar

The MenuBar class implements a menu bar that is attached to the Frame object of a window program.

MenuComponent

The MenuComponent class is the superclass of all menu-related classes and provides a common set of methods used by its subclasses.

MenuItem

The MenuItem class is used to implement items that can be selected from a pull-down menu. It is extended by the Menu and CheckboxMenuItem classes.

Panel

The Panel class is used as a container to organize GUI components within a window. Its default layout is FlowLayout.

Point

The Point class is used to represent general, two-dimensional x,y-coordinates.

Polygon

The Polygon class represents a polygon as a list of x,y-coordinates that identify the polygon's vertices.

Rectangle

The Rectangle class represents a rectangle using the x,y-coordinate of its upper-left corner, its width, and height.

Scrollbar

The Scrollbar class is used to implement vertical and horizontal scrollbars.

TextArea

The TextArea class implements scrollable text-entry objects that span multiple lines and columns.

TextComponent

The TextComponent class is the superclass of all text-based classes. It provides a common set of methods used by the TextArea and TextField classes.

TextField

The TextField class implements a one-line text-entry field.

Toolkit

The Toolkit class provides the linkage between the common AWT supported by Java and the platform-dependent implementation of the AWT.

Window

The Window class is the superclass of all window-related classes and provides a common set of methods for organizing and displaying windows.

Interfaces

LayoutManager

The LayoutManager interface provides a set of methods that are implemented by classes that control the layout of a container.

MenuContainer

The MenuContainer class provides a set of methods that are implemented by classes that contain menus.

java.awt.image

The java.awt.image package defines classes and interfaces that support image generation, storage, and processing.

Classes

ColorModel

The ColorModel class provides a general framework for representing colors and maps this framework to the RGB color model.

CropImageFilter

The CropImageFilter class is used to crop images to a specified area.

DirectColorModel

The DirectColorModel class is used to directly access the color values of a pixel.

FilteredImageSource

The FilteredImageSource class provides the capability to filter an image using an object of class ImageFilter.

ImageFilter

The ImageFilter class provides a common set of methods for implementing an image filter.

IndexColorModel

The IndexColorModel class is a subclass of the ColorModel class that translates fixed colormap pixel values to their RGB component colors.

MemoryImageSource

The MemoryImageSource class is used to create images using an array of pixel values.

PixelGrabber

The PixelGrabber class is used to capture the pixels of an image and store them in an array.

RGBImageFilter

The RGBImageFilter class is used to create image filters that modify the pixels of the default RGB color model.

Interfaces

ImageConsumer

The ImageConsumer interface provides a set of methods for accessing image data provided by classes that implement the ImageProducer interface.

ImageObserver

The ImageObserver interface provides a set of constants and methods through which objects can be notified about an image that is being constructed.

ImageProducer

The ImageProducer interface provides a set of methods for classes that produce images. These methods are used to reconstruct or modify an image being produced.

java.awt.peer

The java.awt.peer package provides a set of interface definitions that map platform-independent AWT classes to their native platform-dependent implementations.

Classes

This package does not have any classes.

Interfaces

ButtonPeer

The ButtonPeer interface specifies the native methods that are required to support the implementation of the java.awt.Button class.

CanvasPeer

The CanvasPeer interface specifies the native methods that are required to support the implementation of the java.awt.Canvas class.

CheckboxMenuItemPeer

The CheckboxMenuItemPeer interface specifies the native methods that are required to support the implementation of the java.awt.CheckboxMenuItem class.

CheckboxPeer

The CheckboxPeer interface specifies the native methods that are required to support the implementation of the java.awt.Checkbox class.

ChoicePeer

The ChoicePeer interface specifies the native methods that are required to support the implementation of the java.awt.Choice class.

ComponentPeer

The ComponentPeer interface specifies the native methods that are required to support the implementation of the java.awt.Component class.

ContainerPeer

The ContainerPeer interface specifies the native methods that are required to support the implementation of the java.awt.Container class.

DialogPeer

The DialogPeer interface specifies the native methods that are required to support the implementation of the java.awt.Dialog class.

FileDialogPeer

The FileDialogPeer interface specifies the native methods that are required to support the implementation of the java.awt.FileDialog class.

FramePeer

The FramePeer interface specifies the native methods that are required to support the implementation of the java.awt.Frame class.

LabelPeer

The LabelPeer interface specifies the native methods that are required to support the implementation of the java.awt.Label class.

ListPeer

The ListPeer interface specifies the native methods that are required to support the implementation of the java.awt.List class.

MenuBarPeer

The MenuBarPeer interface specifies the native methods that are required to support the implementation of the java.awt.MenuBar class.

MenuComponentPeer

The MenuComponentPeer interface specifies the native methods that are required to support the implementation of the java.awt.MenuComponent class.

MenuItemPeer

The MenuItemPeer interface specifies the native methods that are required to support the implementation of the java.awt.MenuItem class.

MenuPeer

The MenuPeer interface specifies the native methods that are required to support the implementation of the java.awt.Menu class.

PanelPeer

The PanelPeer interface specifies the native methods that are required to support the implementation of the java.awt.Panel class.

ScrollbarPeer

The ScrollbarPeer interface specifies the native methods that are required to support the implementation of the java.awt.Scrollbar class.

TextAreaPeer

The TextAreaPeer interface specifies the native methods that are required to support the implementation of the java.awt.TextArea class.

TextComponentPeer

The TextComponentPeer interface specifies the native methods that are required to support the implementation of the java.awt.TextComponent class.

TextFieldPeer

The TextFieldPeer interface specifies the native methods that are required to support the implementation of the java.awt.TextField class.

WindowPeer

The WindowPeer interface specifies the native methods that are required to support the implementation of the java.awt.Window class.

java.io

The java.io package provides a number of classes that support stream-based I/O. These classes are organized into two main class hierarchies under the InputStream and OutputStream classes.

Classes

BufferedInputStream

The BufferedInputStream class provides the capability to implement buffering for an arbitrary InputStream object.

BufferedOutputStream

The BufferedOutputStream class provides the capability to implement buffering for an arbitrary OutputStream object.

ByteArrayInputStream

The ByteArrayInputStream class is used to convert a byte array into an InputStream object.

ByteArrayOutputStream

The ByteArrayOutputStream class is used to convert a byte array into an OutputStream object.

DataInputStream

The DataInputStream class provides the capability to read primitive data types and objects from an InputStream object.

DataOutputStream

The DataOutputStream class provides the capability to write primitive data types and objects to an OutputStream object.

File

The File class is used to provide system-independent access to a file or directory on the host system.

FileDescriptor

The FileDescriptor class provides a system-independent implementation of file descriptor objects.

FileInputStream

The FileInputStream class allows a File object to be used as the basis for creating an object of class InputStream.

FileOutputStream

The FileOutputStream class allows a File object to be used to create an object of class OutputStream.

FilterInputStream

The FilterInputStream class is the superclass of all classes that support input stream filtering.

FilterOutputStream

The FilterOutputStream class is the superclass of all classes that support output stream
filtering.

InputStream

The InputStream class is the superclass of all input stream classes. It provides the methods required to implement an input stream of bytes.

LineNumberInputStream

The LineNumberInputStream class is used to track the line numbers associated with an InputStream object.

OutputStream

The OutputStream class is the superclass of all output stream classes. It provides the methods required to implement an output stream of bytes.

PipedInputStream

The PipedInputStream class is used to provide an input stream to a thread so that it can read data written to a PipedOutputStream object by another thread.

PipedOutputStream

The PipedOutputStream class is used to provide an output stream to a thread so that it can send data to another thread that reads the data from a PipedInputStream object.

PrintStream

The PrintStream class provides an output stream that supports a common set of methods for printing objects and primitive data types.

PushbackInputStream

The PushbackInputStream class is used to provide an output stream that is capable of having data written back onto it so that it can be read again.

RandomAccessFile

The RandomAccessFile class implements a file that can be directly read or written to at arbitrary file locations.

SequenceInputStream

The SequenceInputStream class is used to concatenate a sequence of input streams into a single input stream.

StreamTokenizer

The StreamTokenizer class is used to convert an input stream into a stream of tokens for processing by an input parser.

StringBufferInputStream

The StringBufferInputStream class is used to convert a StringBuffer object for use as an InputStream object.

Interfaces

DataInput

The DataInput interface provides a set of methods for constructing a system-independent implementation of an input stream.

DataOutput

The DataOutput interface provides a set of methods for constructing a system-independent implementation of an output stream.

FilenameFilter

The FilenameFilter interface provides the accept() method for determining whether a filename should be included in a filtered list of filenames.

java.lang

The java.lang package provides the core set of classes that are used in applets, console programs, and window programs. The fundamental classes of the Java class hierarchy are defined within this package. Some java.lang classes also provide access to system-specific information.

Classes

Boolean

The Boolean class provides a class wrapper that is used to access the boolean primitive data type as a Java object.

Character

The Character class provides a class wrapper that is used to access the char primitive data type as a Java object.

Class

The Class class provides runtime information about other classes in the form of a class
descriptor.

ClassLoader

The ClassLoader class is used to define policies for loading classes into the runtime environment.

Compiler

The Compiler class is used to provide access to the Java compiler.

Double

The Double class provides a class wrapper that is used to access the double primitive data type as a Java object.

Float

The Float class provides a class wrapper that is used to access the float primitive data type as a Java object.

Integer

The Integer class provides a class wrapper that is used to access the int primitive data type as a Java object.

Long

The Long class provides a class wrapper that is used to access the long primitive data type as a Java object.

Math

The Math class provides a standard library of mathematical functions.

Number

The Number class is the superclass of all integer and floating-point classes. It can be used to convert a numeric value from one class to another.

Object

The Object class is the superclass of all Java classes and provides methods that are inherited by all Java classes.

Process

The Process class is used to provide system-independent access to processes that are executed using the exec() method of the System class.

Runtime

The Runtime class provides access to the underlying Java runtime system.

SecurityManager

The SecurityManager class is used to implement a security policy for the execution of untrusted classes.

String

The String class is used to implement constant character strings.

StringBuffer

The StringBuffer class is used to implement growable character strings.

System

The System class provides system-independent access to important system resources such as stdin, stdout, and stderr.

Thread

The Thread class is used to implement multithreaded Java programs.

ThreadGroup

The ThreadGroup class is used to organize and control a set of threads as a single entity.

Throwable

The Throwable class is the superclass of all Java errors and exceptions.

Interfaces

Cloneable

The Cloneable interface is implemented by classes that can be copied or cloned.

Runnable

The Runnable interface is implemented by classes that can be executed. It is used to implement threads that are not a subclass of the Thread class.

java.net

The java.net package provides a set of classes that implement socket-based client/server networking.

Classes

ContentHandler

The ContentHandler class is used to extract and process an object that is read from an URLConnection object.

DatagramPacket

The DatagramPacket class encapsulates a datagram object that is read or written from a UDP socket.

DatagramSocket

The DatagramSocket class is used to implement a UDP socket for the transmission and reception of datagrams.

InetAddress

The InetAddress class provides an encapsulation of an Internet host and IP address.

ServerSocket

The ServerSocket provides the capability to create TCP sockets that can be used to implement a server application.

Socket

The Socket class is used to implement a socket used by a client program.

SocketImpl

The SocketImpl class is used to tailor the implementation of Java socket classes to a specific platform or network environment.

URL

The URL class encapsulates URLs and provides a common set of methods for accessing the network resources referenced by an URL.

URLConnection

The URLConnection class is used to manage the HTTP connection created with the resource specified by an URL.

URLEncoder

The URLEncoder class is used to encode information in a format that is suitable for communication via an URL.

URLStreamHandler

The URLStreamHandler class is used to implement an URLConnection for different protocol types.

Interfaces

ContentHandlerFactory

The ContentHandlerFactory interface is used to associate ContentHandler objects with MIME types.

SocketImplFactory

The SocketImplFactory interface is used to create objects of the SocketImpl class.

URLStreamHandlerFactory

The URLStreamHandlerFactory interface is used to associate an URLStreamHandler object with a protocol type.

java.util

The java.util package provides a collection of classes that support a variety of common programming functions.

Classes

BitSet

The BitSet class is used to implement a compact set of bits that can be individually or collectively accessed.

Date

The Date class provides access to the current date and time in a system-independent manner.

Dictionary

The Dictionary class is used to create data container objects that enable data values to be accessed by their associated keys.

Hashtable

The Hashtable class is a subclass of the Dictionary class that allows a collection of objects to be accessed by a hash code value.

Observable

The Observable class enables objects to be constructed that inform observer objects as they are updated. The observer objects must implement the Observer interface.

Properties

The Properties class is a subclass of Hashtable that can be saved or loaded from a stream.

Random

The Random class is used to implement random number generators.

Stack

The Stack class is used to create a stack of objects.

StringTokenizer

The StringTokenizer class is used to parse a String object into a set of tokens.

Vector

The Vector class implements a growable array.

Interfaces

Enumeration

The Enumeration interface provides a set of methods for indexing through a set of objects.

Observer

The Observer interface is implemented by classes that observe objects of the Observable class.