Index

/= operator, 56 Symbols . (dot) - (minus) as current working directory, 12, 20, 24, 29, in command-line options, 26 121, 238 operator, 56 in filenames, 10 in permissions, 11 in regular expressions, 43 in regular expressions, 43 .. (dot-dot) parent directory, 12 in shell pattern matching, 14 ... (ellipsis) in method declarations, 82 -- (double minus) ^ (hat) in command-line options, 26 for the Control key, 18 operator, 56 operator, 56 -= operator, 56 in regular expressions, 43 _ (underscore) in filenames, 10 in shell pattern matching, 14 : (colon) ^= operator, 56 in , 24, 107, 119 ~ operator, 56 in shell pattern matching, 14 ' (single quote) in vi, 37, 43–45 for literals in SQL, 333 ! (exclamation mark) in shell pattern matching, 15 operator, 56 " (double quote) in shell pattern matching, 14 for Strings in , 60, 333 != operator, 56 in shell pattern matching, 15, 108 ? (question mark) [] (square brackets) as command-line option, 29 array operator, 55–56 in shell pattern matching, 14, 196 in regular expressions, 43 in SQL, 333 in shell pattern matching, 14 in URLs, 406, 412 {} (braces) ?: operator, 56 array operator, 55 / (forward slash) for compound statements, 66–70 as file separator, 107 in Javadoc comments, 130 in HTML/XML, 221–222, 433 in shell pattern matching, 108 operator, 56 @ (at), 181 // comments, 66 in command-line options, 117, 123 /* ... */ comments, 66, 128 in Javadoc comments, 128 /** ... */ comments, 128

549 550 Index

$ (dollar) > (greater-than) in format fields, 81 operator, 56 in regular expressions, 43 as redirection command, 6 in shell pattern matching, 15, 22 >= operator, 56 $$ environment variable, 108 >> operator, 56 * (asterisk) >>= operator, 56 in import statements, 85–86 >>> operator, 56 operator, 56 >>>= operator, 56 in password fields, 373 = operator, 56 in regular expressions, 43 == operator, 56, 61, 91 in shell pattern matching, 13, 16, 113, 196 | operator, 56, 391 *= operator, 56 |= operator, 56 \ (backslash) in shell pattern matching, 15 || operator, 56 & (ampersand) operator, 56 Numbers in regular expressions, 43 0wn3d systems, 486 in URLs, 406, 412 2-tier systems, 138 && operator, 56 3-tier systems, 138 &= operator, 56 A # (hash) in comments, 196 a element (HTML), 412 in properties files, 111 A Windowing Toolkit, see AWT % (per cent) abstract access modifier, 94 operator, 56 AbstractTableModel class, 359–363, 368, in regular expressions, 43 389 %= operator, 56 access modifiers, 88–94 + (plus) ActionListener class, 356 operator, 56, 60 actionPerformed(), 356, 367, 371 in permissions, 11 ActiveX, 390 in regular expressions, 43 add(), 142, 352–353, 391 in URLs, 413 addActionListener(), 391 ++ operator, 56 addControlListener(), 392 += operator, 56 addCookie(), 415 < (less-than) addFocusListener(), 392 operator, 56 addHelpListener(), 392 as redirection command, 6 addKeyListener(), 393 < ... > addMouseListener(), 393 in command-line syntax, 73 addMouseMoveListener(), 393 in HTML/XML, 221 addMouseTrackListener(), 393 , 222 addPaintListener(), 393 <% ... %>, 426–431, 434 address space conflicts, 380 <%! ... %>, 429–430, 434 addSelectionListener(), 391–393 <%@ ... %>, 431–433 addTraverseListener(), 393 <%= ... %>, 430–431, 434 afterLast(), 336 << operator, 56 Albaugh, Tyrrell, xxv <<= operator, 56 Albing, Andrew, xxv <= operator, 56 algebraic expressions, 52 alien package, 322 Index 551

Alpha architecture, 186 ASCII encoding, 48, 165, 525–526 Ant, 161, 215–233, 397, 505 asedit, 49 building JAR/WAR/EAR files, 513, 516 ASP clients, 480 command-line options, 223 aspect-oriented programming, see AOP comparing with make, 225 Assert class, 308 datatypes, 228 assertEquals(), 306, 308 documentation, 232–233 assertFalse(), 307 installing, 217–220 assertNotNull(), 306–307 properties, 224 assertNotSame(), 307 targets, 223 assertNull(), 307 tasks, 225–228, 464, 516 assertSame(), 307–308 using with CVS, 516–517 assertTrue(), 307 using with EJBs, 502 assignments, 56, 59, 66 using with gcj, 226 atd, 454, 459 using with JUnit, 303, 312 authentication, 164–165, 324, 485–486 using with NetBeans, 248–249 @author tag (Javadoc), 127–129, 518 using with XDoclet, 517–518 autoconf, 446 ANT_HOME environment variable, 219–220 AWT (A Windowing Toolkit), xxiii, 251, 341, AOP (aspect-oriented programming), 277 344–345, 384 Apache, 217, 321, 444, 446, 464 axe, 48 append(), 419 applets, 131, 145, 165, 226 B appletviewer, 131 backups, 190, 317 application servers, 325, 444, 476 Barry, Dave, 17 applications .bash_profile file, 173 building, 216 shell, 5, 7, 22, 397 deploying, 160–163 .bashrc file, 24–25, 193, 240 developing, see software engineering bean-managed persistence, see BMP distributing, 157 beans, see EJBs, JavaBeans Free, see BeanShell, 259 nonsystem, 446 BEAWeblogic, xxviii Open, see Open Source Beck, Kent, 280 readability of source code, 70 beforeFirst(), 336 releases, 190, 208, 210, 312 Berkeley DB, 321 reliability, 264 BigDecimal class, 54, 175, 333 running, 100, 111–113 BigInteger class, 54 testing, 103–104 binding, 482, 484 archives, 26 BMP (bean-managed persistence), 479 Array class, 333 BNF language grammar, 65 ArrayList class, 333 book’s Web site, xxiv, 229, 350, 395, 417, arrays, 55–57 493, 517, 522 associative, 482 Boolean class, 62 checking, 185 boolean type, 54, 56 multidimensional, 55 converting to String, 80 operators for, 56 BorderLayout class, 352–353, 372, 374, ragged-edged, 57 390 size, 55 Borland, 236 zero-based, 333 BoxLayout class, 354–355, 372, 374 552 Index

break statement, 67, 74–75 characters (continued) browsers, 404 lowercase/uppercase, 61 connecting with a server, 413 ranges, 14–15 plug-ins, 166 check boxes (in GUI), 346 sessions, 414–415 chgrp, 11, 448 Bruce Perens’ Open Source Series, xxii, xxiv, chkconfig, 456, 458–463 523 chmod, 11, 240, 448, 463 BSD/UNIX, 5 chown, 11 B-trees, 321 CICS (Customer Information Control BudgetPro System), 518 as a servlet, 416–420, 423, 430 CIDR (Classless Inter-Domain Routing), 485 buildfile for, 464 CIFS filesystem, 485 database for, 320, 324 class statement, 86 EAR file for, 506–512, 515 classes, 34, 58, 86 in JSP, 424–426, 438 abstract, 305, 368 in , 348–373, 527–537 base, 285 in SWT, 387–395 compiling, 117, 119 buildfiles (build.xml), 220–231, 248, 257, constructors for, 59, 140 516 core language, 86 Button class, 385, 388, 391–392 deprecated, 120, 127, 129 buttons (in GUI), 345, 352, 355–356, 374 documentation, 518 actions, 356–358, 374 extended, 87–91, 96 enabled/disabled, 357, 392 files, 58–59, 84–85, 117, 119 byte type, 53–54 disassembling, see javap bzip2, 218 grouping, 83 inherited, 87–91, 94, 284 inner, 59, 87, 348, 356, 360, 393 C language, 53, 249 instances, 58 C++ language, 249 names, 83–86, 119 exceptions, 77 referencing, 85–86 operator overloading, 52 RMI serial versions, 165 templates, 94 scope, 59 virtual methods, 96 testing, 102 CallableStatement class, 337 without package declaration, 183 Canvas class, 385 classpath, 117–119, 181 Capability Maturity Model, see CMM bootstrap, 117 Caret class, 385 runtime, 119, 121–122 Carnegie, Dale, 274 CLASSPATH environment variable, 84–85, case statement, 67 118, 145, 158, 184, 211, 242, 297, 301, Cash-Peterson, Patrick, xxiv 308, 332, 501 Castor, 321 overriding, 119, 121–122 cat, 17 setting, 119 catch statement, 76–79 clients char type, 54 compiling, 147 characters developing, 142–143 coding, 54 setting up, 144–147 counting, in a file, 9 working with servers, 138 escaping, 9, 15 Index 553

CMM (Capability Maturity Model), 277, context, 479, 484 286, 288–289 initial, 489–491 CMP (container-managed persistence), 476, switching, 476 479 Context class, 490 CNI (Compiled Native Interface), 186 continue statement, 74–75 CodeCommander, 48 Control class, 389 collections, 70–74 cookies, 414–415 color choosers (in GUI), 347 copy tag (Ant), 227 combo boxes (in GUI), 346, 385 CORBA (Common Object Request Broker Combo class, 385 Architecture), 144, 165, 175, 480 command line, 4, 151, 258, 341 CRC cards, 280–288 options, 26, 100–102 createAction(), 371 standard I/O, 6 createButtons(), 355, 391, 394 commands createdb, 324 built-in, 24 createList(), 360, 369, 391, 394 documentation, 29 createStatus(), 353, 358, 391, 394 installing, 24 createuser, 323 online help, 29 csh shell, 5, 105 searching, 24, 29 Cunningham, Ward, 280 comments Customer Information Control System, see in HTML, 428 CICS in Java, 66, 428, 518 CVS (Concurrent Versioning System), 126, in Javadoc, 127–131 189–214, 241 commit(), 77 checkouts, 191, 197–198, 210, 244, 246 Compatibility Test Suite for J2EE, 521 command-line options, 198, 204, 207, 210 compilation, 179–188, 248 commits, 191–194, 198–203, 244, 246 of a multiclass application, 184 differences between versions, 199–201, 246 cross-platform, 180, 186, 446 documentation, 214 with debug information, 120, 227 editor invocations, 198 speed, 348 exports, 210 see also gcj, imports, 196–197 Compiled Native Interface, see CNI logs, 199, 203–205, 246 Composite class, 385, 388–389, 392, 394 merging, 201–203 Concurrent Versioning System, see CVS repositories, 191 conditionals, 66–67 initializing, 193–195 Connection class, 325, 329 remote, 195, 214 constants, 90–91 sandboxes, 191, 194, 210 constructors, 59, 140 status, 205, 246 cont, 156 tags, 191, 205–210 container-managed persistence, see CMP branching, 207–210 containers deleting, 207 EJB, 444, 474, 476, 491, 495 moving, 207 J2EE, 479, 505 sticky, 205, 209 Swing, 344 updates, 191–194, 198, 201–202, 246 Web, 476 using with Ant, 516–517 containsKey(), 111 using with , 259 containsValue(), 111 using with NetBeans, 244–248 CVS directories, 194, 197, 209–210 554 Index

CVS_RSH environment variable, 214, 516 directories (continued) CVSEDITOR environment variable, 198 listing files in, 9, 15 .cvsignore file, 195–196 parent, 12 .cvspass file, 195 permissions of, see permissions CVSROOT directories, 194 directory services, 482–487, 491, 494 CVSROOT environment variable, 193–194, Display class, 381, 384, 386–390 209, 516 dispose(), 380, 388 .cvswrappers file, 195–196 DNS (Domain Name Service), 482–484, 487–491 D Docbook, 221 daemons, 323, 407 , 123, 126 data types @docRoot tag (Javadoc), 130 nonobject, 52 Document Style Semantics and Specification numeric, 53–54 Language, see DSSSL object, 57–64 Document Type Definitions, see DTDs wrappers for, 62 documentation, 122–131 databases, 138, 315–326 comments, 127–131 connecting to, 328–332, 336, 496 links, 127, 130–131 creating, 324 doGet(), 404, 407, 412, 418, 427, 429 interaction with, 327, 480 Domain Name Service, see DNS normalizing, 326 domains, 83 querying, 328, 332–334, 411 doPost(), 405, 407, 412, 418, 427, 429 relational, 322, 518 DoS (Denial of Service) attacks, 489, 491 selection criteria, 318 Double class, 333, 359 setup, 318 double type, 53–54 updating, 336 do-while statement, 68–69, 75 DataSource class, 336 DriverManager class, 329, 336 DataType class, 228 DSSSL (Document Style Semantics and Date class, 81 Specification Language), 221 Davidson, James Duncan, 216–217 DTDs (Document Type Definitions), 220, Debian, 47, 322, 457, 463 222 debugging, 91, 103, 136, 148–151 dump, 156 adding information to class files, 120, 176 DynamicJava, 259 declarations, in JSP, 434 default statement, 67 E DefaultTableModel class, 368 e3, 49 @deprecated tag (Javadoc), 120, 129 EAR files, 28, 506–514 destroy(), 404, 407 building with Ant, 513, 516 dialogs (in GUI), 370–373 deploying, 514–516 dismissed, 372 echo, 239 modal, 372 Eclipse, 175, 251–258, 378–379, 382, 396, dir, 14 464 directories, 483–484 documentation, 260, 383 current working, 12, 20, 24, 29, 107, 121, downloading, 252 238 GTK vs. Motif versions, 252, 383, 396 home, 107 installing, 251–254 Index 555

Eclipse (continued) enumerated values, 90–91 perspectives, 253 Enumeration class, 71, 490 Debug, 253–254 env, 108 Java, 256–258 ENVFILE environment variable, 109–110 Resource, 253–256 .envfile file, 110 projects, 254 environment variables, 22–25, 104–109, 219 refactoring, 258–259, 388 exporting, 22, 105 using with CVS, 259 names, 105 using with JUnit, 312 passing to Java, 107 using with XDoclet, 519 setting, 23, 105 views, 253 substituting, 15 working with, 257–258 environments, 104–110 ed, 47 equals(), 61 eddi, 48 equalsIgnoreCase(), 61 EDITOR environment variable, 198 Error class, 306 ejbCreate(), 496 error handling, 75–79 EJBHome class, 498–499 error messages, 6–8, 112 EJB-JAR files, 508–511 /etc/inittab, 451–453, 457 ejb-jar.xml, 509–511, 519 events EJBLocalHome class, 499–501 loops, 381 EJBLocalObject class, 499–501 time, 348 EJBObject class, 495, 497–498, 512 ex, 37 ejbRemove(), 496 Exception class, 76–77, 306, 490 EJBs (Enterprise JavaBeans), 138, 148, 216, @exception tag (Javadoc), 130 473–492, 518 exceptions, 75–76, 79, 130 activating/passivating, 475–476, 496 catching, 78 compiling, 501–502 creating, 77 creating, 475 extending, 75, 77 deploying, 505–519 null pointer, 59 destructing, 475 stack trace, 77 documentation, 503 throwing, 76–77 entity, 475–476, 479, 492, 499, 503 Exclude datatype (Ant), 228 implementing, 474, 493–503 exec(), 111–113 message, 475, 481 executeUpdate(), 336 session, 475–481, 492, 495, 499 exit, 24 stateful, 476, 478–479, 502 export, 23, 105, 194 stateless, 476–477, 495–498 expressions using with Ant, 502 in Java, 66 elvis, 34–35 in JSP, 434 Emacs, 34, 48–49, 214 .exrc file, 44–45 encapsulation, 86–87 ext directory, 301, 332 endsWith(), 61 extcheck, 164 Enterprise Java, see J2EE extends statement, 87–88, 92 Enterprise JavaBeans, see EJBs Extensible HyperText Markup Language, see enterprise systems, 138 XHTML EntityBean class, 475 Extensible Markup Language, see XML enum statement, 91 556 Index

float type, 53–54 F FlowLayout class, 354 fail(), 307 folders, see directories false constant, 54 for statement, 69–70 FAT filesystem, 485 for arrays, 74 Fedora, 322, 324, 452–453, 456, 458–463 changing execution, 75 FetchURL, 97, 158 for collections, 74 compiling, 117–118, 182–183 compared with the while loop, 70, 73 running, 121, 148–156 with multiple expressions, 69 file, 16–17 in shell scripts, 21, 25 file choosers (in GUI), 347 form element (HTML), 406 File Transfer Protocol, see FTP format fields, 80–82 filenames, 9–10, 168, 483–484 Formatting class, 82 case sensitiveness, 10 Free Software, xxiii–xxiv, xxviii, 180, 379, changing, 12, 25 446, 522–523 extensions, 10 FSF (), xxiii, 180 spaces in, 10 fte, 49 files FTP (File Transfer Protocol), 142, 485 access time, 21 counting characters, words, lines in, 9 G deltas, 210 garbage collection, 380, 388, 436 descriptors, 102–104 Garbage In, Garbage Out, 312 modification time, 9, 16, 21 gcc (GNU Compiler Collection), 181, 188 moving, 11–13 gcc (GNU C Compiler), 180 ownership of, see owners gcj (GNU Compiler for Java), xxiii, xxv, 157, permissions of, see permissions 181–188, 379 searching, 19–21 command-line options, 182–185 size, 9, 16 documentation, 188 temporary, 109 installing, 144 types, 17 performance, 186–187 viewing, 18 using with Ant, 226 filesystems, 483, 485 using with SWT, 396–398 mounted, 170–171, 245 GECOS, 447 networked, 171 gEdit, 48 FillLayout class, 390 General Public License, see GNU GPL FilterSet datatype (Ant), 228 generics feature, 94–95 final access modifier, 87, 90–91, 96 Gentleware, 249 finally statement, 78–79 Geronimo, 464–466, 495, 501, 521 find, 19–21, 29, 397 deploying, 515 fireTableCellUpdated(), 369 documentation, 468–469, 519 fireTableChanged(), 369 installing, 467 fireTableDataChanged(), 368–369 mapping, 509 fireTableRowsDeleted(), 369 running, 468 fireTableRowsInserted(), 369 GET request, 406 fireTableRowsUpdated(), 369 getAttribute(), 414 fireTableStructureChanged(), 369 getColumnCount(), 360 Float class, 62 getColumnName(), 360 Index 557

getConnection(), 329 GTK (GIMP Toolkit), 252, 383 getContentPane(), 352 GUI, 151, 341 getCookies(), 415 and program parameters, 100 GetDomain class, 489 construction time, 348 getenv(), 105–106 designing, 347–374 getInt(), 334–335 graphical objects, 345–347 getName(), 363 native compiled, 378–379 getOwner(), 363 rigid areas, 355 getParameterNames(), 412 gvim, 35 getParameterValues(), 413 gzip, 218, 466 getPlatform(), 390 getProperties(), 106 H getProperty element (JSP), 435 hard links, 168–171 getProperty(), 106, 110–111 Hashtable class, 106, 111 getRow(), 336 Hashtables class, 70 getRowCount(), 360 Hayes, Andrew, xxv getSelectedRow(), 367 head, 18 getSelectionModel(), 366 header files, 133 getSession(), 414 “Hello, world” getString(), 334–335 in Swing, 342–344 getTableCellRendererComponent(), in SWT, 381–384 364 Web page, 407–410 getTableHeader(), 369 , 321 getTotal(), 363, 435 HOME environment variable, 25, 105, 160 getty, 451 hosts, 83 GetUser class, 132–137 HTML (HyperText Markup Language), 221, getValueAt(), 360, 363–364, 367 405 getVersion(), 390 comments, 428 GHOME environment variable, 501 dynamically generated, 406–407 gid (group ID), 446–447 forms, 406, 412 GIGO (Garbage In, Garbage Out), 312 generated from XML, 406 GIMP (GNU Image Manipulation Program), hyperlinks, 416 252 using for prototyping, 275 Glimmer, 48 HttpRequest class, 414 GNOME, 48 HttpServlet class, 404, 407, 430 GNU, xxiv, 5, 26, 179–180 HttpServletRequest class, 415 GNU C Compiler, see gcc HttpServletResponse class, 418 GNU Classpath, 182 HURD microkernel, 180 GNU Compiler Collection, see gcc Huseth, Steve, xxv GNU Compiler for Java, see gcj hyperlinks, 416 GNU GPL (General Public License), xxiv, HyperText Markup Language, see HTML 180, 182, 379, 539–547 I GNU/Linux, see Linux GnuPG (GNU Privacy Guard), 164, 218–219 I/O, 79 Graphics2D class, 385 closing, 78 grep, 18–19, 180 redirecting, 6, 163 Group class, 385, 389, 391 standard, 6–8, 102–104 558 Index

IBM, 236, 377, 518 interfaces (continued) Common Public License, 379 local, 492, 495, 499–501 developerWorks, xxv, 396 local home, 500 Java SDK, xxiii, xxiv, 167–177, 378 remote, 144, 474, 478, 492, 494–495, debugging, 176 497–498, 512 differences from SUN Java SDK, remote home, 498 174–176 internationalization, 80–81 installing, 173 IP addresses, 482–484 performance, 175 IPv6, 485 MQSeries, 481 IRIX , 456 PC, 34, 48 isAfterLast(), 335 Web site, 176–177 isBeforeFirst(), 335 ide.cfg, 238 isCellEditable(), 365 Idea IDE, 236 isEmpty(), 111 ident, 324 isFirst(), 335 Identifiable class, 88 isLast(), 335 IDEs (Integrated Development ISO (International Organization for Environments), 213, 235–260, 505 Standardization), 485 IDL (Interface Definition Language), 144, 165 isTotal(), 435 if-else statement, 66–67 iterators, 70–74 inline, 56 in shell scripts, 21 J IIOP (Internet Inter-ORB Protocol), 144, J2EE (Java 2 Enterprise Edition), 28, 115, 165, 175, 480 148, 444, 464–466, 498–499, 501, 510, ImageIcon class, 358 517–518 implements statement, 87, 92 documentation, 492, 503 import statement, 85–86, 90, 432 J2SE (Java 2 Standard Edition), 62, 115 include C/C++ directive, 85 Jakarta project, 438, 444 Include datatype (Ant), 228 JApplet class, 344 IndexOutOfBounds exception, 62 jar, 28, 157–164, 506, 513 info, 30 command-line options, 163–164 init, 452 JAR files, 17, 28, 122, 157–164 init(), 404, 407, 512 building with Ant, 513, 516 InitialContext class, 487 digitally signed, 164–165 InitialDirContext class, 490 in NetBeans, 241 initialization files, 24 jar tag (Ant), 227 InnoDB tables, 317 jarsigner, 164 int type, 53, 333 java, 121–122, 156, 158, 175 converting to String, 80 command-line options, 122 Integer class, 62, 359 Java, 94–95, 522 Integrated Development Environments, and Open Source, xxiii–xxiv, 521 see IDEs comments, 66, 428, 518 IntelliJ, 236 documentation, xxviii, 166 interfaces, 87–88, 139 performance, 378 generating with XDoclet, 518 portability, 53 home, 474, 494–495, 498–499, 511–512 version 5.0, 73, 80, 90, 94 implementating, 87–88, 91–92 versions 1.2 and older, 105 inherited, 88 versions 1.3 and newer, 106 Index 559

Java Compiler, see javac javaw, 175 Java Data Objects, see JDO JBoss, 495, 501, 521 Java DataBase Connectivity, see JDBC configurations, 462 Java Debugger, see jdb deploying, 515 Java Decompiler, see javap documentation, 469, 519 JAVA_HOME environment variable, 173, downloading, 444 219–220, 332 installing, 446, 450–451, 463 Java Naming and Directory Interface, see JBoss-IDE, 464 JNDI mapping, 509–511 Java Native Interface, see JNI using with JNDI, 491 Java Runtime, see java using with XDoclet, 519 Java SDKs (Software Development Kits) JBOSS_HOME environment variable, 459, 462 IBM, see IBM Java SDK jboss.xml, 509–511 installing, 144 JBOSSSH environment variable, 462 Sun, see Sun Java SDK JBuilder IDE, 236 switching between, 168, 173 JButton class, 354–358, 374, 385–386, 388 Manager, 104 JCheckboxMenuitem class, 385 Java VMs (Virtual Machines), 95, 111, 175, JComboBox class, 385 186–187, 383 JComponent class, 386 java..path, 383 jCVS, 211–213 .java.policy file, 146, 165 documentation, 214 JavaBeans, 321, 337, 474 JCVS environment variable, 212 duration, 436 jdb (Java Debugger), 148–151 enterprise, see EJBs JDBC (Java DataBase Connectivity), session, 439 321–322, 325, 327–338, 480, 496 using with JSP, 434–437 documentation, 337 javac, 24, 117–120, 173, 186, 216 downloading, 332 command-line options, 100, 119–120, 148 JDialog class, 344, 374 debugging, 120, 148 JDK, see Sun diagnostics on success, 117 JDK_HOME environment variable, 173 performance, 186–187 JDO (Java Data Objects), 321 javac tag (Ant), 225 JED, 48 Javadoc, 62–64, 114, 122–131, 227 jedit, 47 “Use” pages, 126 JEditorPane class, 386 at-tags, 128, 518 JFace class, 380 command-line options, 123–127 JFormattedTextField class, 386 comments, 127–131 JFrame class, 344–345, 351–354, 373–374, documentation, 128 384, 388–389 downloading, 64 jgnash, 158 running, 123 Jikes compiler, 177, 227 javadoc tag (Ant), 227 JITs (Just-In-Time compilers), 175, 186, 378 javah, 132–137 JLabel class, 344, 353–354, 364, 373–374, javap (Java Decompiler), 157–160 384–385, 388 JAVAPTH environment variable, 459, 462 JList class, 385 JavaScript, 412 JMenu class, 385 JavaServer Pages, see JSP JMenuItemA class, 385 560 Index

JNDI (Java Naming and Directory Interface), JUnit (continued) 336, 482–491, 509 failures, 306 contacting with, 511 GUI version, 302 documentation, 491–492 installing, 297–303 using with JBoss, 491 test cases, 303–309 JNI (Java Native Interface), 113, 132–137, test suites, 309–311 186, 378 using with Ant, 303, 312 joe, 48 using with Eclipse, 312 JPanel class, 352–355, 370, 374, 385–386 JPasswordField class, 373, 386 K JProgressBar class, 385 KDE, 100, 252 JPython, 259 Kerberos, 165 JRadioButtonMenuitem class, 385 kernel, 4, 446 JScrollPane class, 369, 374, 385 keytool, 165 JSlider class, 386 kill, 468 JSP (JavaServer Pages), 138, 416, 423–441, Kirsanova, Alina, xxv 444 KISS principle (Keep It Simple, Stupid!), 282 declarations, 429–430, 434 konsole, 6 directives, 431–433 Kumar, Deepak, xxv documentation, 440 L expressions, 430–431, 434 generated from XML, 434 Label class, 384–385, 388, 391–392 predefined variables, 432 labels (in GUI), 346, 353–354, 374, 385 scriptlets, 427–429, 434 layout managers, 347–348, 372, 374, 392 updating, 433 LayoutManager class, 374 using with JavaBeans, 434–437 LD_LIBRARY_PATH environment variable, using with servlets, 425, 430 135, 383 validating, 434 LDAP (Lightweight Directory Access XML syntax for, 434 Protocol), 140, 485–487 JSpinner class, 385 distinguished names, 485 JSTL (JSP Standard Tag Library), 437–438, ldconfig, 135 440 length(), 61 JTable class, 359–364, 367–368, 370, 374, less, 17 386 Lessig, Lawrence, 522, 524 JTableColumn class, 386 libgcj, 182, 188 JTableHeader class, 369 libraries JTabPane class, 386 in command-line options, 181 JTextArea class, 374, 386 names, 135 JTextField class, 372–374, 386 shared, 135, 383 JTextPane class, 374, 386 @link tag (Javadoc), 130–131 JTree class, 374, 386 LinkedLists class, 70 JUnit, 295–313 Linux, xxiii, 107, 180, 522 assertions, 305–308 philosophy, 524 command-line version, 303 as programmer-friendly platform, xxi documentation, 313 releases, 34 downloading, 299–301 tools, 5 errors, 306 list, 156 Index 561

List class, 385 Microsoft list(), 110 Active Directory, 487 lists (in GUI), 346, 385 Internet Explorer, 166 Lists class, 70 Message Queue Server, 481 ListSelectionListener class, 366 MS-DOS, 10, 14, 163 ListSelectionModel class, 365–367 Windows, 161, 163, 217, 253, 255, 319, load(), 110 381 loadLibrary(), 135 Miller, Andy, xxv log files, 18, 104 mkdir, 194 Logajan, George, xxv mkdir tag (Ant), 227 Long class, 62 Model/View/Controller design pattern, 359, long type, 53 438 lookup(), 142 modularization, 9 loops, 67–75 MoneyBean, 496 ls, 6, 9, 15, 24, 100, 180, 240, 446, 483 Mono project, 521 LVM (Logical Volume Manager), 171 Monty Python, 215 Moore, Dan, xxv M more, 17, 238 Macromedia Flash, 166 Motif, 47, 49, 252, 383 main(), 100–102, 121–122, 161 MouseAdapter class, 393 specifying on command line, 183, 185 MouseListener class, 393 mainframe clients, 480 Multics project, 6 make, 216, 397 multitier systems, 137, 143, 147, 518 comparing with Ant, 225 MutableTreeNode class, 386 makefiles, 216 mv, 11–13, 100 man, 29–30 MyISAM tables, 317 manifest files (MANIFEST.MF), 122, 161–162, MySQL, 317, 328 507, 511 connecting to, 329 marshaling/unmarshaling, 143, 482, 495, 500 documentation, 317, 326 mbedit, 47 JDBC for, 332, 337 md5sum, 218–219 mysqld, 459 memory leaks, 380 Menu class, 385 N MenuItem class, 385 \n , 81, 107 menus (in GUI), 346, 385 namespaces, 83, 484 MessageBean class, 475 naming services, see directory services META-INF directory, 507, 511 NamingEnumeration class, 490 methods native2ascii, 165 calls, 66 NDS (Novell Directory Service), 487 defining, 58 NEdit, 47 deprecated, 120, 127, 129 .NET development environment, 480, 521 native, 132–137, 216 NetBeans, 236–251 overriding, 96 CVS in, 244–248 remote, 143 documentation, 259–260 return values, 75 downloading, 237 scope, 59 editing, 243–244 with variable argument list length, 82 GUI, 240–244 void, 75 installing, 237–239 562 Index

NetBeans (continued) OSI (Open Systems Interconnection), 485 running, 239–240 OTN (Oracle Technology Network), 318 using with Ant, 248–249 owners of files, 9–10, 16 using with C/C++, 249 changing, 11, 170, 448 using with servlets, 430 group, 10, 445–450, 463 new statement, 56–59, 87 other, 10 newline characters, in output, 79 user, 10 NewStringUTF(), 134 next, 156 P next(), 73 pack(), 345, 352 NFS (Network File System), 459, 485 package statement, 83–85, 125, 183 nobody user, 323 packages nonblocking revisions, 317 default, 183 Novell Directory Service, see NDS directories, 84 NTFS filesystem, 485 documentation, 123 numbers, 53–54 names, 83–84, 146 nvi, 34 protecting, 83 size, 83 O panels (in GUI), 347 Object class, 61, 87, 94, 359 @param tag (Javadoc), 130, 518 objects, 57 Pascal, 69 comparing, 56 passwords, 285, 324, 373 converting to String, 80 root, 445–450 creating, 56 sharing, 445–446 grouping, 70 storing, 195, 447 referencing, 59–60 supplying in URL, 329 ODMG (Object Data Management Group), PATH environment variable, 24–25, 105, 144, 321 173, 219, 239 OJB (Object Relational Bridge), 321 pattern matching, 13–15 OLE class, 390 PatternSet datatype (Ant), 228 OOA (object-oriented analysis), 279–280, Payback, 123, 161–163 285, 287 buildfile for, 229–231 OOD (object-oriented design), 279–287, 359 compiling, 184 OOP (object-oriented programming), xxviii, pBeans, 321 57 Perens, Bruce, xxv Open Publication License, The, xxiv Perl, 44, 446 Open Source, xxiii–xxiv, xxviii, 5, 46, 189, permissions, 10–11, 445, 463 213, 379, 522–524 changing, 11, 448 openejb-jar.xml, 509 for directories, 9, 449 operators, 55–56 for files, 9, 16 overloading, 52 for hard links, 170 precedence, 55 persistent storage, 316, 320–322 unary, 55–56 pg, 17 Oracle, 316, 318, 328, 332 PGP signatures, 218 connecting to, 329 pico, 47 documentation, 337 pipes, 8–9, 238, 258 orbd, 175 pkzip, 163 Index 563

pointers, 134 null, 59, 75 policytool, 165 radio buttons (in GUI), 345 polymorphism, 91–94 RAID (Redundant Array of Inexpensive portability, 53, 106, 113, 186–187, 216, 319, Disks), 171 380 Raymond, Eric, xxiii, 449 portmanteau abbreviations, 157 RealPlayer, 166 portmap, 459 rebind(), 142 Poseidon for UML, 249 RedHat, 217, 322, 452, 456, 458–463 POST request, 406, 412 Package Manager, see rpm postgres user, 323 regular expressions, 19, 43–44 postgresql, 459 RemoteException exception, 139–140 PostgreSQL, 317, 328 remove(), 71 documentation, 317, 326 repeat-until statement, 69 installing, 322 ResultSet class, 329, 334–337 predicates, 20–21 return statement, 75 Prentice Hall PTR, xxiv, 523 @return tag (Javadoc), 130 PreparedStatement class, 329, 333, 335, rigid areas (in GUI), 355 337 rm, 109 print(), 79 RMI (Remote Method Invocation), 137–148, printf(), 79–82 216, 482 println(), 79, 419 building with Ant, 228 printStackTrace(), 77 registry, 140, 142, 487 PrintStream class, 79 stubs, 138, 143–144 private access modifier, 83, 88–89, 125 rmic, 137, 143–144, 147, 216, 228 processes rmic tag (Ant), 228 IDs, 108 rmid, 165 running, 121 rmiregistry, 144, 148 programs, see applications Robot class, 312 progress bars (in GUI), 346, 385 rollback(), 77 ProgressBar class, 385 root (superuser), 11, 323, 445–450, 452, 462 project element (Ant), 223–224 RowLayout class, 391 Properties class, 106, 109–111, 224 RowSets class, 337 properties files, 109–111, 113 rpm, 217 comments in, 111 rsync, 485 names, 110 run, 148 property element (Ant), 224 runlevels, 452–459 propertyNames(), 111 Runtime class, 111–113 protected access modifier, 88–89, 125 S prototyping, 274–276, 416 proxies, 143, 494 Saint-Exupéry, Antoine de, 282 ps, 468 SAMoney class, 496 public access modifier, 83, 88–90, 124 Sash class, 389 put(), 111 Scale class, 385 scriptlets, 427–429, 434 Q scroll panes (in GUI), 347, 369–370 Qt library, 252 Scrollable class, 389 564 Index

ScrollBar class, 385 setenv, 105 search engines, 412 setgid bits, 449 security, 165, 323–324, 486 setHorizontalScrollBarPolicy(), 370 and default groups for users, 448 setHorizontalTextPosition(), 358 and root access, 445, 462 setInt(), 333 auditability, 445 setLayout(), 355, 390 checksums, 218 setProperty element (JSP), 435 digital signatures, 164, 218 setProperty(), 111 passwords, 324, 446–450 setReorderingAllowed(), 368 policy files, 146, 165 setResizingAllowed(), 368 security managers, 142, 145 Sets class, 70 SecurityException exception, 104 setStatus(), 368, 392 SecurityManager class, 131 setString(), 333 sed, 44, 47, 258 setters, 104 @see tag (Javadoc), 130 setText(), 354, 364 Selection class, 392 setTimestamp(), 333 selection listeners, 365–368, 393 setTotal(), 435 SelectionAdapter class, 393 setUp(), 305, 309 SelectionListener class, 393 setVerticalScrollBarPolicy(), 370 SelectionModel class, 374 setVerticalTextPosition(), 358 serialver, 165 setVisible(), 345, 352 servers, 404–407, 410, 443–469 SGML (Standard Generalized Markup compiling, 146–147 Language), 220–221 connecting with a browser, 413 Shell class, 381, 384, 386–391 developing, 139–142 shell languages, 21 setting up, 144–147 shell scripts, 22, 319 Service Provider Interface, see SPI JUnit tests, 303 service(), 404 loops, 25 Servlet class, 404, 406 parameters, 25 servlets, 138, 403–421, 512 running, 24, 108 designing, 416–420 for startup, 193 documentation, 440 shell variables, see environment variables MIME for, 432 shells, 4, 21–26 packaging, 512–514 shopping cart, 477–478, 481 session variables, 414, 431, 437, 439, 441 short type, 53 using as daemons, 407 short-circuiting, 56 using with JSP, 425, 430 Slider class, 386 Sesame Street, 343 sliders (in GUI), 346 Session class, 139–142 SMAC (SMall ANSI C Interpreter), 48 SessionBean class, 475, 495–498, 512 SMB filesystem, 485 setAttribute(), 414 software, see applications setBigDecimal(), 333 software engineering, 57, 263–279 setDefaultCloseAction(), 344 documenting, 272–274 setDefaultRenderer(), 364 iterative approach, 266, 277 setDouble(), 333 requirements, 266–276, 288 setEnabled(), 357 Software Engineering Institute, 277 setEntityContext(), 475 sorting, 107 Index 565

source control, 126, 189–190, 213 , 94, 106, 166, 187, 236, files for, 195 321, 521 SourceForge, 299 Java SDK, xxiii, xxiv, 115–166, 378 SPARC, 186 differences from IBM Java SDK, SPI (Service Provider Interface), 487–491 174–176 split panes (in GUI), 347 Enterprise Edition, see J2EE SpringLayout class, 372 installing, 173 sprintf(), 82 Micro Edition, 115 SQL, 328, 333–336 Standard Edition, see J2SE Stallman, Richard, xxiii, 179–180, 522, 524 SOS (SunONE Studio), 236, 251 standard error, 6–8 Web site, 64–65, 98, 161, 166, 337, 375, Standard Generalized Markup Language, see 421, 441, 491–492 SGML superuser, see root standard input, 6–8, 47, 103 Swing, xxiii, 251, 309, 341–376 standard output, 6–8, 47, 103 compared to SWT, 379, 384–388, 395 piping, 8, 107 containers, 344 reassigning, 104 documentation, 375 redirecting, 6, 104, 108 graphical objects, 345–347 Standard Widget Toolkit, see SWT performance, 378 startsWith(), 61 portability, 380 Statement class, 337 using with HTML, 373 statements, in Java, 64–75 switch statement, 67 static access modifier, 87, 90–91, 102 SWT (Standard Widget Toolkit), xxv, 175, static initializers, 133, 135 251, 377–399 status lines (in GUI), 352, 358 ActiveX support, 390 step, 156 adapters, 393 STL algorithms, 95 and garbage collection, 380 Stochniol, Andrzej, 49 compared to Swing, 379, 384–388, 395 store(), 111 documentation, 381, 383, 398 stored procedures, 480 installing, 381 streams, 109 performance, 378 strftime(), 81 portability, 380 String class, 60–62, 86 using with gcj, 396–398 StringBuffer class, 60 SWT class, 390 strings SWTException class, 390 comparing, 61 symlinks (symbolic links), 171–172, 239, 451, concatenating, 60, 79 467 length, 61 circular chains, 172 searching, 18–19 dangling, 172 substrings, 61 System class, 86, 102–109 strlen(), 54 System V init system, 451–458, 463 StrongARM, 186 su, 445, 450 T substring(), 61 tabbed panes (in GUI), 347 Subversion, 189 TabFolder class, 386 sudo, 445–446 TabItem class, 386 566 Index

Table class, 386, 394–395 ToolBar class, 386 table element (HTML), 386, 411 toolbars (in GUI), 347, 386 TableCellEditor class, 386 ToolItem class, 386 TableCellRenderer class, 374, 386 toString(), 77, 80, 91, 359, 363–364, 419, tableChanged(), 368 430, 490 TableColumn class, 386, 394–395 touch, 433 TableColumnModel class, 386 toUpperCase(), 61 TableItem class, 386, 394–395 tr element (HTML), 411 TableModel class, 359, 368, 374 translations, see internationalization TableModelEvent class, 368–369 traverse(), 397 TableModelListener class, 368 Tree class, 386 tables (in GUI), 346 TreeItem class, 386 background color, 364 trees (in GUI), 346, 386 editors, 365 true constant, 54 renderers, 363–365 try statement, 76–79 scrolling, 369–370 in Swing, 352, 359–363, 374 U in SWT, 394–395 uid (user ID), 446–447 tag libraries, 437–438 Umbrello, 287, 290 tail, 18 UML (Unified Modeling Language), 249, tar, 26–29, 163, 217, 466 285, 287, 289 command-line options, 26, 238 UnicastRemoteObject class, 140 examining contents of files, 238 Unicode, 54, 134, 165 target element (Ant), 223–224 UNIX Task class, 228 archive formats, 163, 217 Taub, Mark, xxiv commercial versions, 252 TCP/IP, 482, 485 daemon processes, 323 td element (HTML), 411 filesystems, 483–485 tearDown(), 305, 307, 309 online manuals, 29 TestCase class, 303–305, 308 operating system commands, 4 TestRunner class, 309 philosophy, 524 TestSuite class, 309 as programmer-friendly platform, xxi, 397 text areas (in GUI), 346 releases, 34 Text class, 386 shell scripts, 319 text fields (in GUI), 346, 372, 374, 386 standard I/O, 6, 102 text panes (in GUI), 346 tools, 5 the, 48 user interface, 4 Thinking in Java, 52, 58, 60, 65, 94, 98 unzip, 27, 299 throw statement, 76–77 inspecting files before unzipping, 299 throws keyword, 306 URLEncoder class, 413 @throws tag (Javadoc), 130 URLs, 404–406 time value of money, 495–497 parameters in, 412–413, 436 Timestamp class, 333 passwords in, 329 toLowerCase(), 61 useBean element (JSP), 435 Tomcat, 259, 407, 410, 430, 444 USER environment variable, 105 tool tips (in GUI), 346 UTF-8 encoding, 134 Index 567

WebSphere Studio, xxviii, 236 V well-formedness, 221 validation, 220 which, 24 variables while statement, 67–68 declaring inside for loops, 69 changing execution, 75 local, 77 compared with the for loop, 70, 73 of object type, 59 whitespace @version tag (Javadoc), 126 in filenames, 10 vi, 5, 34–45, 49 trailing, 44 case sensitiveness, 44 Widget class, 389, 391–392 copying/pasting, 39 windows (in GUI), resizing, 343, 353–355 deleting, 39 WordStar, 48–49 exiting, 40–41 indentation, 40, 45 X modes, 35 X Window, 47, 252, 380 ex, 37–38, 40–44 X.500 standard, 485 input, 35–36, 40, 45 X11, 49 vi, 35 xcoral, 48 positioning, 36–38 XDoclet, 517–518 repeating commands, 40 documentation, 519 searching, 38–39, 41–44 generating interfaces, 518 substitutions, 41–44 using with Ant, 517–518 undoing/redoing, 40 using with JBoss, 519 using with CVS, 198 xedit, 48 using with NetBeans, 244 Xelfi, see NetBeans words in, 37 XFree86, 446 vim, 34–35, 40 XHTML (Extensible HyperText Markup virtual access modifier (C++), 96 Language), 221 Virtual Network Console, see VNC xinetd, 458 VISUAL environment variable, 198 XML (Extensible Markup Language), VNC (Virtual Network Console), 137 220–222 Vogen, Kirk, xxv, 396 using for JSP, 434 Von Neumann architecture, 343 XML Schema, 220 XSLT (XSL Transformations), 221 W xterm, 6 WAR files, 28, 464, 512 building with Ant, 513, 516 Y wc, 9 YaST, 47–48 Web browsers, see browsers Web pages, 405 Z changing, 423 zip, 26–29, 466 common parts, 432 ZIP files, 17, 157 dynamically generated, 406–407, 411 inspecting before unzipping, 299 static, 405, 416 in NetBeans, 241 Web servers, see servers Zoetebier, John, 237 web.xml, 512–513, 519 zone transfers, 491 WEB-INF directory, 512