| applets/ | applets on web pages |
| apps/ | applications with graphical user interfaces |
| include/ | auxiliary files to adapt make for various platforms |
| programs/ | programs without graphical user interfaces |
| Introduction | |
|---|---|
| programs/hello | a first program |
| apps/hello | a first application |
| applets/hello | a first applet |
| The Programming Language Java | |
| programs/int/ | integer values |
|
| ranges, bit operations |
|
| dividing by zero, ArithmeticException |
|
| conversions, raising an Exception |
| programs/float/ | floating point values |
|
| ranges, special values |
|
| solves a quadratic equation; conversions, arithmetic |
| programs/boolean/ | conditions |
|
| conversions |
| programs/wc/ | counting characters, package documentation |
|
| base class: processing the command line, designing the methods |
|
| base class: implementing the auxiliary methods |
|
| counts bytes |
|
| counts characters, UTF8 encoding |
|
| counts lines, words, characters, and bytes with selectable encoding; demonstrates command option processing and specialized input streams |
| programs/char/ | characters and strings |
|
| properties, emulates printenv |
|
| examples of inner classes |
|
| evaluates arithmetic expressions; nested and anonymous classes |
|
| command line as a Reader, emulates expr |
| programs/main/ | command line processing |
| programs/cmd/ | command line processing examples |
|
| trivial example for flags and options |
|
| lists files or standard input; demonstrates working with file names |
|
| counts lines, words, characters, and bytes with selectable encoding; demonstrates adapting the Wc classes to CommandLine |
|
| lists information about files; demonstrates path operations |
| programs/sort/ | sorting |
|
| sorts arguments or lines, trivial implementation |
|
| lists arguments, trivial example for Print and Elements |
|
| sorts arguments, simple example for Sorted, Comparable and Comparer |
|
| sorts lines in ascending or descending order, simple example for Lines |
|
| sorts system properties in ascending or descending order |
|
| sorts system properties in ascending or descending order with a Comparable class |
|
| sorts Float values from input lines in ascending or descending order with a Comparer class AsFloat |
| applets/thread/ | thread status |
|
| lists thread status in an applet or an application as diagnostic output |
|
| shows thread status in an applet in a text field of the applet demonstration for suitable browsers |
| programs/thread/ | threads |
|
| many threads list the command line arguments |
|
| many threads list the command line arguments but only the last one should write a line feed; demonstrates synchronisation problem |
|
| many synchronized threads list the command line arguments and only the last one writes a line feed |
|
| reader-writer problem: main thread produces command line arguments, several synchronized threads compete to write the output |
|
| reader-writer problem: main thread produces command line arguments, several synchronized threads compete to write the output; demonstrates Semaphore |
|
| five dining philosphers share five forks for five courses; demonstrates conditional access to semaphores (forks) |
|
| scans for command line argument on input lines |
|
| scans for all command line arguments on one input line; uses instances of Grep as parallel threads connected by pipes |
| The Abstract Window Toolkit | |
| apps/gui/ | simple examples for all visible objects and their events; invoked with awt.main (require JDK >= 1.1) |
| applets/gui/ | the same examples on web pages with awt.LoaderApplet and event display in awt.Listener (require appletviewer or hotjava) |
|
| Button and arranging with a Panel [applet] |
|
| Canvas with mouse events; quit by leaving the drawing area [applet] |
|
| Checkbox connected with CheckboxGroup arranged with Panel; quit by selecting Really and then Quit [applet] |
|
| Choice; quit by selecting Quit [applet] |
|
| Dialog, regular and modal versions [applet] |
|
| FileDialog to load and store files [applet] |
|
| asynchronous display of an image in a Canvas loaded from a local file or from the net; quit by double clicking the image; uses ImageView [applet] |
|
| Label with colors; quit by double clicking Quit [applet] |
|
| List; quit by selecting Really and then double clicking Quit [applet] |
|
| MenuBar and related classes, creates menus from a symbolic description; `_' is replaced by blank, entries with capitals receive shortcuts [applet] |
|
| PopupMenu to color a Label [applet] |
|
| Scrollbar connected to a TextField [applet] |
|
| ScrollPane to show an image with an ImageView; quit by double clicking the image [applet] |
|
| TextArea with changeable attributes [applet] |
| apps/awt/ |
package to analyze event handling
(requires JDK >= 1.1) |
|
| accepts a class name as argument, loads a Panel or a Frame as an application and .properties files to filter event display |
|
|
accepts a class name as class parameter
and optionally an applet name as listener parameter,
loads a Panel or a Frame as an applet
and connects it to the Listener applet
(requires appletviewer or hotjava) |
|
| class with lots of inner classes to display events; can be used as an applet and accepts parameters to initialize event display |
|
| TextArea with a thread to emulate a PrintWriter |
| Event Management | |
| apps/calc/ | various calculators as examples for event handling strategies (require JDK >= 1.1) |
| applets/calc/ | the same examples on web pages with awt.LoaderApplet (require appletviewer or hotjava) |
|
| trivial calculator chip as finite state machine |
|
| configurable keyboard as a new Component |
|
| calculator application with Fsa [applet] |
|
| calculator chip with javacc |
|
| Cpu with listing |
|
| calculator application with Cpu, uses standard output |
|
| calculator application with Cpu [applet] |
|
| calculator application with Cpu and Gate connections for listing [applet] |
| apps/edit/application | framework for multi-document applications (requires JDK >= 1.1) |
| apps/edit/edit/ | multi-document editor (requires JDK >= 1.1.6) |
| Layout Management | |
| apps/layout/ | examples for CardLayout and GridBagLayout (require JDK >= 1.1) |
| applets/layout/ | the same examples on web pages (require JDK >= 1.1) |
|
| general Panel with CardLayout [applet] |
|
| panel to inspect a GridBagConstraints object [applet] |
|
| experiments with GridBagLayout [applet] |
| Client/Server Programming | |
| programs/tcp/ | TCP sockets |
|
| line oriented client |
|
| echo server |
|
| proxy server for spying |
|
| multi-threaded client |
| programs/udp/ | UDP sockets |
|
| line oriented client, optionally with timeouts |
|
| echo server, with super server, timeouts and random errors |
| programs/web/ | simulation of a database connected to the web |
| applets/web/ | query page |
|
| ``database'' with standard i/o and TCP interface |
|
| simple web server with standard i/o and TCP interface |
|
| query applet [applet] |
| programs/rmi/ | Remote Method Invocation (requires JDK >= 1.1.4) |
|
| client and server for current time |
|
| client and server for error reports |
|
| extension; demonstrates object migration |
| Database Access | |
| programs/jdbc/ | examples for Java Database Connectivity |
|
| interactive SQL |
|
| practice and test application from InterSolv |
| The Parser Generator JavaCC | |
| programs/javacc/ | examples from compiler construction |
|
| recognition, javacc |
|
| error handling |
|
| evaluation |
|
| abstract syntax tree, jjtree |
|
| operator tree |
|
| infix and interpretation |
|
| semantic analysis and interpretation, class hierarchy for Java expressions |