1.
Determining If a File or Directory Exists (Java Developers Almanac ...
Code Examples from The Java Developers Almanac 1.4. ... boolean exists = (new File("filename")).exists(); if (exists) { // File or directory exists } else ...
2.
Connecting to a MySQL Database (Java Developers Almanac Example)
Driver"; // MySQL MM JDBC driver Class.forName(driverName); // Create a connection to the database String serverName = "localhost"; String mydatabase ...
3.
Listing All System Properties (Java Developers Almanac Example)
Code Examples from The Java Developers Almanac 1.4. ... Get all system properties Properties props = System.getProperties(); // Enumerate all system ...
4.
Moving the Focus with the TAB Key in a JTextArea Component (Java ...
Rather than try to find the inputmap or keymap with the TAB binding and remove it, it is better to add an overriding key binding that will move the focus. ...
5.
Handling Action Events (Java Developers Almanac Example)
addActionListener(new MyActionListener()); public class MyActionListener implements ActionListener { public void actionPerformed(ActionEvent evt) ...
6.
Finding Elements by Attributes in a DOM Document Using XPath (Java ...
This example demonstrates some common uses of expressions that use attributes; for more information on XPath, see the specification at ...
7.
Finding Elements by Absolute Location in a DOM Document Using ...
Note: This example uses the XPath packages ( org.apache.xpath.* ) available in J2SE 1.4. However, these packages are not yet part of the Java 2 API and so ...
8.
Finding Elements by Content in a DOM Document Using XPath (Java ...
Code Examples from The Java Developers Almanac 1.4. ... In the example, the result of an XPath expression is shown next to the expression; the numbers are ...
9.
Examples from The Java Developers Almanac 1.4
Code Examples from the Java Developers Almanac 1.4.
10.
Finding Elements by Attributes in a DOM Document Using XPath (Java ...
This example demonstrates some common uses of expressions that use attributes; for more information on XPath, see the specification at ...