Chapter 1: Hello Java...............................................................................................................................................
The Power of the Concept........................................................................................................................
Network-Awareness...................................................................................................................
Portability....................................................................................................................................
Security........................................................................................................................................
Memory Segmentation.........................................................................................................
Native Methods....................................................................................................................
Access to System Resources via Java..................................................................................
Object Orientation......................................................................................................................
Cooperating Objects...........................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 2: The Java Language...............................................................................................................................
Files and Packages.....................................................................................................................................
Using the Example Applets......................................................................................................................
Language Basics: A Quick Tour..............................................................................................................
Classes and Methods.................................................................................................................................
Variables and Scope..................................................................................................................
Finality.................................................................................................................................
C++ Compatibility.....................................................................................................................
Control Flow................................................................................................................................................
Simple and Composite Types..................................................................................................................
Types and Initialization............................................................................................................................
Arrays...........................................................................................................................................................
Multi-Dimensional Arrays........................................................................................................
Operators.....................................................................................................................................................
Interfaces.....................................................................................................................................................
C/C++ Incompatibility..............................................................................................................................
Operator Overloading................................................................................................................
Pointers.........................................................................................................................................
Multiple Class Inheritance........................................................................................................
Java Style....................................................................................................................................................
javadoc Class Tags....................................................................................................................
javadoc Method Tags...............................................................................................................
javadoc Variable Tags..............................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 3: The Example Application....................................................................................................................
Overall Structure.........................................................................................................................................
The AgentLauncher...................................................................................................................................
The AgentServer.........................................................................................................................................
The Agent Network....................................................................................................................
Standalone Applications versus Applets................................................................................
The AgentContext Interface....................................................................................................
The Dispatching AgentServer...................................................................................................
Agents...........................................................................................................................................................
Applet or Application?..............................................................................................................
Configuring An Agent................................................................................................................
How Does An Agent Report Results?.....................................................................................
One Run of an Agent.................................................................................................................
Objects vs. Classes.....................................................................................................................................
Why Java?...................................................................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 4: The Applet Class....................................................................................................................................
My What Big Applets You Have............................................................................................................
When Does an Applet Run?.....................................................................................................................
A Multi-Applet Environment and the AppletContext.........................................................................
Dealing With Stopped Applets.................................................................................................................
Applets and Hyperlinks.............................................................................................................................
Reloading Applets......................................................................................................................................
Conclusion...................................................................................................................................................
Exercises:.....................................................................................................................................................
Chapter 5: User Interfaces With Awt.....................................................................................................................
The Graphical Hierarchy..........................................................................................................................
Components, Containers and Panels.....................................................................................................
Layouts........................................................................................................................................................
GridBagLayout...........................................................................................................................
Layout in the AgentLauncher..................................................................................................
Getting User Input Via Predefined Controls..........................................................................................
Text Buttons...............................................................................................................................
Image Buttons............................................................................................................................
Dialogs/Forms.............................................................................................................................
Scrolling........................................................................................................................................
Menus...........................................................................................................................................
Other Controls.............................................................................................................................
Flow Control................................................................................................................................................
Events, Actions and Messages...........................................................................................
Drawing and the Graphics Context.........................................................................................................
The update and paint Methods...............................................................................................
The Coordinate System............................................................................................................
Fonts.............................................................................................................................................
Color.............................................................................................................................................
Text Controls..............................................................................................................................
Using Images...............................................................................................................................................
The ImageObserver Interface..................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 6: Managing Multitasking.........................................................................................................................
What are Threads?.....................................................................................................................................
Creating Threads........................................................................................................................................
The Thread Class.......................................................................................................................
The Runnable Interface............................................................................................................
The Start and Run methods.....................................................................................................
Thread Control...........................................................................................................................
Thread Attributes.......................................................................................................................
When Do Applet Threads Run?...............................................................................................................
Shared Resources and Synchronization................................................................................................
Efficient Serialization................................................................................................................
Subterranean Threads...............................................................................................................................
Inter-Process Communication.................................................................................................................
Inter-Thread Communication.................................................................................................................
Inter-Applet Communication..................................................................................................................
When to Thread..........................................................................................................................................
Animation....................................................................................................................................................
Using Non-Daemon Threads....................................................................................................
Native Methods..........................................................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 7: Network Communication.....................................................................................................................
URLs.............................................................................................................................................................
Word Searching A URL.............................................................................................................................
Dealing With Content Other Than Simple Text....................................................................................
A Link Checking Applet............................................................................................................................
Using Sockets..............................................................................................................................................
Socket Basics..............................................................................................................................
The Snitch Applet.......................................................................................................................
InetAddress.................................................................................................................................
To Block, or Not To Block.......................................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 8: Exceptions...............................................................................................................................................
The Exception Class..................................................................................................................................
When to Catch Exceptions.......................................................................................................................
Finally...........................................................................................................................................
Catching Multiple Exceptions..................................................................................................
Scope and Exceptions...............................................................................................................
Catching Interfaces...................................................................................................................
When to Throw Exceptions......................................................................................................................
Catching a Dying Thread..........................................................................................................................
When to Throw Other Objects.................................................................................................................
Unblocking Blocked IO.............................................................................................................
Reusing Threads.........................................................................................................................
Native Exceptions......................................................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 9: Downloadable Classes..........................................................................................................................
The ClassLoader Class..............................................................................................................................
The Primordial Class Loader....................................................................................................................
Loading Agents...........................................................................................................................................
Conclusion...................................................................................................................................................
Exercises......................................................................................................................................................
Chapter 10: Security In Detail.................................................................................................................................
Why Be Secure?.........................................................................................................................................
Terminal Access.........................................................................................................................
Network Access..........................................................................................................................
Local File Access........................................................................................................................
Security In Applets.....................................................................................................................................
Security In Standalone Applications......................................................................................................
The SecurityManager Class.....................................................................................................................
Conclusion...................................................................................................................................................
Exercises:.....................................................................................................................................................