?? index.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><!-- This file edited for Java Jumpstart CD --><HEAD><META VALUE="keyword" CONTENTS="codesamples"><META name="generator" content="HTML Tidy, see www.w3.org"><TITLE>Examplets from The Java Developers Almanac 2000</TITLE><META name="OWNER" content="Editorial/JDC"><META name="revision" content="@(#)index.src 1.29 03/17/99 JDC"><STYLE type="text/css"> <!-- CODE {font-family: Courier, Monospace; font-size: 12pt} PRE {font-family: Courier, Monospace; font-size: 11pt} --> </STYLE></HEAD><!-- Start Body Insert--><BODY bgcolor="#FFFFFF" text="#000000" link="#0000FF" alink="#FF0000" vlink="#660066"><!-- End Body Insert--><!-- Start PageTop Insert --><TABLE><TR><TD><P></P><TABLE border="0" width="100%" cellpadding="0" cellspacing="0"><TR valign="TOP"><TD width="100%"><IMG src="../../../images/chiclet.row.gif" width="55" height="18" alt=""></TD><TD rowspan="4" align="RIGHT" width="152"><IMG src="../../../images/developer.connection.header.gif" border="0"height="42" width="319" alt="Java Developer Connection(SM)"></TD></TR><TR valign="TOP"><TD bgcolor="#FFFFFF" height="1" width="100%"><IMG src="../../../images/pixel.gif" height="1" width="1" alt=""></TD></TR><TR valign="TOP"><TD bgcolor="#CC9966" height="1" width="100%"><IMG src="../../../images/pixel.gif" height="1" width="1" alt=""></TD></TR><TR valign="TOP"><TD><IMG src="../../../images/codesamples.gif" width="165" height="22" alt="Code Samples" border="0"></TD></TR></TABLE><!-- End PageTop Insert --><TABLE border="0" cellpadding="0" cellspacing="0"><TR><TD><FONT face="Verdana, Arial, Helvetica, sans-serif"><!-- Template Version 2.0 --> <!-- ================== --><!-- Start Main Content --><!-- ================== --> <A name="top"></A></FONT><DIV align="right"><FONT face="Verdana, Arial, Helvetica, sans-serif"></FONT><H2><FONT face="Verdana, Arial, Helvetica, sans-serif">Exampletsfrom The Java Developers Almanac 2000<BR></FONT></H2></DIV><CENTER><TABLE border="0" cellpadding="0" cellspacing="0" width="90%"><TR><TD bgcolor="#336666" height="2" width="90%"><IMG src="../../../images/pixel.gif" height="2" width="2" alt=""></TD></TR></TABLE></CENTER><TABLE border="0" cellspacing="0" cellpadding="0" width="90%"><TR><TD valign="TOP"><FONT face="Verdana, Arial, Helvetica, sans-serif"></FONT><P><FONT face="Verdana, Arial, Helvetica, sans-serif"><BR></FONT></P><TABLE border="0" cellpadding="0" cellspacing="0" width="90%"><TR><TD><FONT face="Verdana, Arial, Helvetica, sans-serif"><BR>The following code Examplets<SUP><FONT size="-2">TM</FONT></SUP>are Copyrighted 2000 by Addison-Wesley and Patrick Chan and are provided as a courtesy for your educational, non-commercial use.</FONT><BR><BR>Examplets are code snippets that illustrate a particular task.They're designed to show which classes and members are involved inperforming the task, and how the classes and members interact witheach other. You will see blue italicized text in an examplet; thisindicates code that should be replaced if you use it in yourprogram.</FONT><P><FONT face="Verdana, Arial, Helvetica, sans-serif">An exampletcan have enough detail for you to use it, as is. Or you might haveto get more information about the involved classes. A good place tofind information about the Java 2 Platform APIs is the <A href="../../../products/jdk/1.2/docs/api/index-files/index-1.html">Java2 Platform API index</A>.</FONT></P><P><FONT face="Verdana, Arial, Helvetica, sans-serif">It's alsogood practice to add catch clauses, as appropriate, to theexamplets. If the code of an examplet throws a checked exception,the code is surrounded by a try/catch statement. However, to reducespace and distraction, the catch clause is left blank. Catchclauses should always handle the exception and should never be leftblank. So, at the very least, you should include a call to<CODE>e.printStackTrace()</CODE> to display the exception on theconsole.</FONT></P><P><FONT face="Verdana, Arial, Helvetica, sans-serif">You'll findexamplets in a variety of categories. See the <A href="#exmtoc">Table of Contents</A> for a list of categories, and theexamplets in each category.<BR clear="ALL"><BR></FONT></P><CENTER><FONT face="Verdana, Arial, Helvetica, sans-serif"></FONT><TABLE border="0" cellpadding="0" cellspacing="0" width="90%"><TR><TD bgcolor="#336666" height="2" width="90%"><IMG src="../../../images/pixel.gif" height="2" width="2" alt=""></TD></TR></TABLE></CENTER><FONT face="Verdana, Arial, Helvetica, sans-serif"><A name="exmtoc"></A></FONT><H3><FONT face="Verdana, Arial, Helvetica, sans-serif">Table ofContents</FONT></H3><TABLE border="0" cellpadding="5" cellspacing="0"><TR><TD valign="TOP"><FONT face="Verdana, Arial, Helvetica, sans-serif"><A href="#Accessibility">Accessibility</A><BR><A href="#java.lang">Arrays</A><BR><A href="#Applets">Applets</A><BR><A href="#java.lang">Application and System</A><BR><A href="#AWT (Abstract Windowing Toolkit)">AWT (Abstract Windowing Toolkit)</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#AWT (Abstract Windowing Toolkit) (java.awt)Clipboard">Clipboard</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#AWT (Abstract Windowing Toolkit) (java.awt)Drag and Drop">Drag and Drop</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#AWT (Abstract Windowing Toolkit) (java.awt)Events">Events</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#AWT (Abstract Windowing Toolkit) (java.awt)Fonts">Fonts</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#AWT (Abstract Windowing Toolkit) (java.awt)Shapes">Shapes</A><BR><A href="#Compression">Compression</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#Compression (java.util.zip)JAR files">JAR files</A><BR><A href="#Database - JDBC">Database - JDBC</A><BR><A href="#Data Structures and Algorithms">Data Structures and Algorithms</A><BR><A href="#Files, Streams, I/O">Files, Streams, I/O</A><BR><A href="#Images">Images</A><BR><A href="#Internationization">Internationization</A><BR><A href="#JavaBeans (tm)">JavaBeans</A> <FONT size="-2"><SUP>TM</SUP></FONT><BR><A href="#JavaxNaming">JNDI</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#JavaxNamingDirectory">Directory</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#JavaxNamingEvent">Event</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#JavaxNamingLdap">Ldap</A><BR><A href="#Math">Math</A><BR><A href="#Networking">Networking</A><BR><A href="#Printing">Printing</A><BR><A href="#Reference Objects">Reference Objects</A><BR><A href="#Reflection">Reflection</A><BR><A href="#RMI">RMI</A><BR><A href="#Security">Security</A><BR><A href="#Sound">Sound</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#JavaxSoundSampled">Sampled</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#JavaxSoundMidi">Midi</A><BR><A href="#java.lang">Strings</A><BR><A href="#Swing">Swing</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#Swing (javax.swing)Events">Events</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#Swing (javax.swing)File Chooser">File Chooser</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#Swing (javax.swing)Layout">Layout</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#Swing (javax.swing)Tree">Tree</A><BR><IMG src="../../../images/pixel.gif" width="20" height="2" alt=""border="0"><A href="#JavaxSwingText">Text</A><BR><A href="#java.lang">Threads</A><BR><A href="#java.lang">Time</A><BR><A href="#JavaxRmi">javax.rmi</A><BR><A href="#JavaxSwingUndo">javax.swing.undo</A><BR></FONT> </TD><TD valign="TOP"><FONT face="Verdana, Arial, Helvetica, sans-serif">(javax.accessibility)<BR>(java.lang)<BR>(java.applet)<BR>(java.lang)<BR>(java.awt)<BR>(java.awt.datatransfer)<BR>(java.awt.dnd)<BR>(java.awt.event)<BR>(java.awt.font)<BR>(java.awt.geom)<BR>(java.util.zip)<BR>(java.util.jar)<BR>(java.sql)<BR>(java.util)<BR>(java.io)<BR>(java.awt.image)<BR>(java.text)<BR>(java.beans)<BR>(javax.naming)<BR>(javax.naming.directory)<BR>(javax.naming.event)<BR>(javax.naming.ldap)<BR>(java.math)<BR>(java.net)<BR>(java.awt.print)<BR>(java.lang.ref)<BR>(java.lang.reflect)<BR>(java.rmi)<BR>(java.security)<BR><BR>(javax.sound.sampled)<BR>(javax.sound.midi)<BR>(java.lang)<BR>(javax.swing)<BR>(javax.swing.event)<BR>(javax.swing.filechooser)<BR>(java.awt and javax.swing)<BR>(javax.swing.tree)<BR>(javax.swing.text)<BR>(java.lang)<BR>(java.lang)<BR>(javax.naming)<BR>(javax.naming.directory)<BR>(javax.naming.event)<BR>(javax.naming.ldap)<BR>(javax.rmi)<BR>(javax.swing.undo)<BR></FONT> </TD></TR></TABLE><FONT face="Verdana, Arial, Helvetica, sans-serif"><BR clear="ALL"></FONT><CENTER><FONT face="Verdana, Arial, Helvetica, sans-serif"></FONT><TABLE border="0" cellpadding="0" cellspacing="0" width="90%"><TR><TD bgcolor="#336666" height="2" width="90%"><IMG src="../../../images/pixel.gif" width="2" height="2" alt="" border="0"></TD></TR></TABLE></CENTER><FONT face="Verdana, Arial, Helvetica, sans-serif"><BR></FONT><TABLE border="0" cellpadding="5" cellspacing="0"><TR><TD valign="TOP" colspan="3"><FONT face="Verdana, Arial, Helvetica, sans-serif"><B><A name="Accessibility">Accessibility</A></B>(javax.accessibility)</FONT></TD></TR><TR><TD valign="TOP"><IMG src="../../../images/pixel.gif" width="20"height="2" alt="" border="0"></TD><TD valign="TOP" colspan="2"><FONT face="Verdana, Arial, Helvetica, sans-serif"><A href="javax.accessibility/174.html">The Quintessential AccessibleObject</A><BR> <A href="javax.accessibility/175.html">Setting an Accessible Namefor an Image Button</A><BR> <A href="javax.accessibility/176.html">Setting a Description forImage Icons</A><BR> <A href="javax.accessibility/177.html">Setting a Mnemomic forButtons</A><BR> <A href="javax.accessibility/178.html">Setting a Mnemonic for aMenu</A><BR> <A href="javax.accessibility/179.html">Associating a Label with aComponent</A><BR> <A href="javax.accessibility/180.html">Setting a KeyboardAccelerator for a Menu Item</A><BR></FONT> </TD></TR><TR><TD valign="TOP" colspan="3"><FONT face="Verdana, Arial, Helvetica, sans-serif"><B><A name="Applets">Applets</A></B> (java.applet)</FONT></TD></TR><TR><TD valign="TOP"><IMG src="../../../images/pixel.gif" width="20"height="2" alt="" border="0"></TD><TD valign="TOP" colspan="2"><FONT face="Verdana, Arial, Helvetica, sans-serif"><A href="java.applet/0.html">The Quintessential Applet</A><BR> <A href="java.applet/1.html">Getting an Applet Parameter</A><BR> <A href="java.applet/2.html">Making the Browser Visit aURL</A><BR> <A href="java.applet/3.html">Showing a Message in the Browser'sStatus Bar</A><BR> <A href="java.applet/4.html">Loading and Playing Audio in anApplet</A><BR> <A href="java.applet/5.html">Loading and Playing Audio in anApplication</A><BR> <A href="java.applet/6.html">Loading and Painting an Image in anApplet</A><BR> <A href="java.applet/7.html">Animating an Array of Images in anApplet</A><BR></FONT> </TD></TR><TR><TD valign="TOP" colspan="3"><FONT face="Verdana, Arial, Helvetica, sans-serif"><B><A name="AWT (Abstract Windowing Toolkit)">AWT (Abstract WindowingToolkit)</A></B> (java.awt)</FONT></TD></TR><TR><TD valign="TOP"><IMG src="../../../images/pixel.gif" width="20"height="2" alt="" border="0"></TD><TD valign="TOP" colspan="2"><FONT face="Verdana, Arial, Helvetica, sans-serif"><A href="java.awt/8.html">The Quintessential Drawing Program</A><BR> <A href="java.awt/9.html">Drawing Basic Shapes</A><BR> <A href="java.awt/10.html">Filling Basic Shapes</A><BR> <A href="java.awt/11.html">Loading an Image</A><BR> <A href="java.awt/12.html">Drawing an Image</A><BR> <A href="java.awt/13.html">Scaling, Shearing, Translating, andRotating a Drawn Image</A><BR> <A href="java.awt/14.html">Drawing Simple Text</A><BR> <A href="java.awt/15.html">Drawing Rotated Text</A><BR> <A href="java.awt/16.html">Getting the Dimensions of Text</A><BR> <A href="java.awt/17.html">Drawing Anti-Aliased Text andGraphics</A><BR> <A href="java.awt/18.html">Drawing with Alpha</A><BR> <A href="java.awt/19.html">Setting the Clipping Area with aShape</A><BR> <A href="java.awt/20.html">Changing the Thickness of the StrokingPen</A><BR> <A href="java.awt/21.html">Creating a Shape from a StrokedShape</A><BR> <A href="java.awt/22.html">Stroking or Filling a Shape</A><BR> <A href="java.awt/23.html">Stroking or Filling with aColor</A><BR>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -