|
Index of Code Samples
This is a master index of JavaTM programming language code
samples organized by topic. Your browser's built-in search function in the Edit menu can also
help you locate topics.
Cross-Platform Technologies
- Internationalization: Designing an application so it can be adapted to various languages and regions
without engineering changes. Localization is the process of adapting software for a specific region or language by adding
locale-specific components and translating text.
- Java BluePrintsTM: Illustrating design patterns and best practices for Java platform-based end-to-end (client-server) solutions.
- Performance Tuning: Learning strategies and tactics for optimizing the performance of programs written in the Java programming language.
- Security: Signing and verifying signed data, encrypting and decrypting data, and writing a security manager. A security manager is a Java virtual machine (JVM1) object that implements a security policy such as prompting an end user for password verification.
JiniTM Network Technology
J2EETM Platform
These code samples show you how to use the J2SE and J2EE platform APIs, for writing programs that run on Java platform-enabled servers.
Application Clients
- Desktop applications: Writing client programs that run on a Java platform-enabled client machine. A desktop application might connect to a server-side technology such as a J2EE server.
Business Processing
Client Communications
- JavaServer PagesTM Technology: Creating Web content that has both static and dynamic components.
- Servlets: Extending a server program to enhance its functionality. One very common use for
servlets is to extend a Web server by providing dynamic Web content.
Message Communications
Network Communications
- JDBC Technology: Invoking SQL commands to create database tables, access the data stored in a table, and create and manage distributed transaction. The J2SE 1.4 and all versions of the J2EE platforms provide these APIs. Prior to J2SE 1.4, you have to download the
javax.sql package for distributed transactions separately.
- J2EE Connector Architecture: Enabling J2EE components such as enterprise beans to connect to and interact with Enterprise Information Systems (EISs).
- Resource Connections: Setting Enterprise beans and Web components up to access resources such as databases, a mail session, Java Message Service objects, and URLs.
- Transactions: Rolling back a transaction in the event of an error and maintaining database integrity.
J2METM Platform/Small Devices
- J2ME Tech Tips
- Small devices: Writing client programs that run on small wireless devices such as cell phones, personal digital assistants, and smart cards, and larger wired or wireless devices such as Internet-enabled smart phones.
J2SE Platform
These code samples show how to use core APIs from the J2SE platform, which aggregates APIs that can apply to both distributed and non-distributed applets and applications. For additional code samples that apply to the J2SE platform, see also:
Advanced Topics
- Reference Objects: Maintaining special references to objects that allow the program to interact with the garbage collector in limited ways.
- Reflection: Representing or reflecting the classes, interfaces, and objects in the JVM.
- Threaded Programs: Timing, setting thread priority, and synchronizing threads.
Applets
- Applets: Writing small client programs that run in a Java platform-enabled browser. The small program is embedded in a web page, and might connect to a server-side technology such as a J2EE server. Running applets securely using Java Web Start is also covered.
Classes, Objects, & Inheritance
Deployment
Essential APIs
- Characters & Strings: Performing character and string operations.
- Collections: Grouping multiple elements into a single unit (collection). Collections let you
store, retrieve, and manipulate data, and transmit data from one method to another.
- Error Handling: Using exceptions for error handling in the Java programming language.
- JavaBeansTM Technology: Using APIs and tools that let you create reusable, platform-independent software components that you can combine into applets, applications, or composite components.
- Language Basics: Using variables, arrays, operators, flow of control, and
scope.
- Numbers and Math Operations: Using floats, doubles, arithmetic operations, converting numbers to strings, trigonometry, and more.
- Reading and Writing Data: Reading data from and write data to external storage. Includes serialization and custom protocol handling.
Graphical User Interfaces (GUIs)
- Graphical User Interfaces with JFC Swing: Building GUIs with the Swing package, which is part of the Java Foundation Classes (JFC). Includes code samples for the Accessibility API.
- Multi-Media: Enhancing a user interface with 2D graphics, 3D graphics, printing, imaging, and sound.
Network Communications
- CORBA/IDL: Letting distributed objects interact regardless of whether they are written in the Java programming language or another language.
- Java Native Interface (JNI): Integrating native code into programs written in the Java programming language.
- Remote Method Invocation (RMI): Establishing remote communications between programs written in the Java programming language. RMI enables an object running in one JVM to invoke methods on an object running in another JVM.
Open Source
These code samples are from various open source repositories.
XML/Web Services
- Java API for XML processing (JAXP): Accessing XML documents either serially (SAX) or in random access mode (DOM).
- Web Services: Creating web-based services that are accessed by business application programs. The service receives the request for its services and returns a response.
Reader Feedback
Tell us what you think of this section.
1 As used on this web site, the terms Java virtual
machine or JVM mean a virtual machine for the Java platform.
|
|