Java Reference
In-Depth Information
many standard editing functions, including cut, copy, paste, insert, and delete.
For more information on using shortcuts, selecting text, and moving the inser-
tion point through the coding window, see Appendix C.
Entering Code to Import Packages
The classes and methods needed to display the system date are not
immediately available, which means the programmer must tell the compiler
to access the storage location in order to use these methods. The SDK includes
class packages as part of the standard installation. Recall that class packages, or
libraries, contain portable Java bytecode files. Because hundreds of these files
are available, Java organizes them, by category, into packages.
Some of the more widely used Java packages and their descriptions are listed
in Table 2-7. The Java API contains a complete list of Java packages.
Table 2-7
Java Packages
PACKAGE NAME
DESCRIPTION
EXAMPLES OF CLASSES IN PACKAGE
java.applet
Provides the classes necessary to create an
Class used to create the applet window
applet and the classes an applet uses to
and methods to initialize, start, and stop
communicate with its applet context.
the applet.
java.awt
The Abstract Window Toolkit (AWT) provides the Classes to define GUI objects, including
classes for creating user interfaces and for
Button, Label, TextField, and Checkbox.
painting graphics and images.
java.awt.event
Provides interfaces and classes for dealing
Classes to support events, including
with different types of events fired by AWT
ActionEvent, WindowEvent, MouseEvent,
components, such as button clicks and key
and KeyEvent.
press events.
java.io
Provides classes that support system input and
Classes to handle I/O methods, including
output through data streams, serialization,
FileReader, InputStreamReader, and
and the file system.
BufferedReader.
java.lang
Provides classes that are fundamental to the
Classes such as those related to String,
design of the Java programming language,
System, Double, Integer, Float, and
which facilitate data types, threads, Strings,
Thread.
and others.
java.net
Provides classes used for networking and
Classes related to networks, such as URL,
client/server applications.
InetAddress, and NetworkInterface.
java.util
Provides classes for the date and time facilities,
Classes related to time (such as Date,
internationalization, and miscellaneous utilities.
Calendar, and Timer) and location (such
as Locale and TimeZone).
javax.swing
Provides a set of lightweight Java-based
Classes to define GUI components such
components.
as JApplet, JOptionPane, JLabel,
JTextField, and JScrollBar.
 
Search WWH ::




Custom Search