Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
When examining the new release, do keep the bug-reporting URL handy (see Resources), as Joey Jarosz, president of hot-n-GUI Inc., an Internet design and consulting company, reports that it took his crew less than five minutes to find code that worked in the previous Java version but not in the 1.3 release. If you're eager to learn the details of the new release, the following provides a brief synopsis of what's new and different. As we'll see, you'll find plenty of new features, lots of bug fixes, changes to the existing toolset, and, unfortunately, some incompatibilities with previous Java versions.
Version 1.3 of the Java 2 SDK introduces many improvements to the core Java 2 platform. Some of these changes improve Java's performance. (For example, there is roughly a 20 percent performance improvement in serialization/deserialization during RMI calls.) The vast majority of them, however, add additional capabilities to the core API set for the Java 2 platform.
Taking an API-level approach to the different changes, the following provides an overview of how the Java 2 platform has grown. Starting with the API documentation, the following new packages reveal several major additions:
java.awt.im.spi.spi subpackages for service providers.) The Input Method Framework SPI provides the ability to create alternative input mechanisms
-- you can now suppport handwriting recognition on a Palm device, for instance. A tutorial is provided (see Resources) that lets users enter city names by using three-character airport codes.
javax.media.sound.midi and javax.media.sound.sampledjavax.rmijavax.rmi.PortableRemoteObject (instead of UnicastRemoteObject), and you cannot depend on or use any of the distributed garbage-collection facilities.
javax.namingorg.omg.* and javax.transactionIn addition to full-fledged package additions, new classes have been added to existing packages, and new methods and constants to existing classes. We'll first look at the features focusing on the Abstract Windowing Toolkit (AWT). Then, we'll look at the enhancements outside of AWT.
Font class provides dynamic font loading support through the new createFont() method. You'll no longer have trouble trying to make sure your users have specific fonts installed. For the time being, this
method only supports TrueType fonts.
JobAttributes and PageAttributes classes, offering the ability to control paper size and orientation.
GraphicsConfiguration class.
java.awt.Robot class allows you to automate user interface testing by generating native UI events.
java.awt.Component with the new getListeners(Class listenerType) method.
paint() method in a C/C++ native library.
DataFlavor class provide better text transfer support for drag-and-drop and clipboard transfers.
Outside of AWT there are other enhancements:
java.lang.Math class has been moved to java.lang.StrictMath. There is a new Math class that permits answers to be different from old answers, under certain circumstances.
List and Map, to go along with the singleton Set; an empty Map to go along with the empty List and Set; and a constructor for WeakHashMap that accepts a Map.
Runtime class has a new method public void addShutdownHook(Thread hook) that provides a shutdown hook, for registering threads to run when the Java Virtual Machine begins its shutdown process.
The above simply highlights the many changes present in the Java 2 SDK, version 1.3. Unfortunately, the source code for the libraries isn't included with this beta release.
As is the case with most upgrades, you get your share of bug fixes in the 1.3 release of the Java 2 SDK. Sun's bug fix list (see Resources) includes 452 bugs that have been corrected. The area with the largest number of corrections is the JFC/Swing classes. Due to the significant number of changes as well as bug fixes to the JFC/Swing libraries, the JFC/Swing development team posted a description of the changes to The Swing Connection (see Resources).
Included with the bug fix list is a tally of votes from developers who are in the JDC Bug Parade. The bugs fixed with the leading number of votes follow:
PrintJob disregards the Properties (212 votes)
JTextPane no longer dispatches keyTyped events to a KeyListener (132 votes)
JInternalFrame.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE) is ignored (103 votes)
If you voted for one of these fixes, be sure you clear your vote and vote for another bug that you'd like to see Sun fix. There's still time to try to convince Sun to fix other problems with the 1.3 release. Unfortunately, for things like PNG (Portable Network Graphics -- an image format like GIF and JPEG) support, you need to look outside the core capabilities for support with the 1.2 release of the Java 2 platform (or go back further to the Java 1.1 runtime environment).
Besides all the library changes and added functionality, as described above, some of the underlying tools have changed. For example, the Java 2 Runtime Environment includes HotSpot technology and has been optimized for client-side performance, including reduced startup time. A quick test of the startup of a JFC/Project Swing example shows roughly a 25 to 50 percent startup improvement on a three-year-old Pentium Pro machine, a representative example of a typical machine used by a nondeveloper.
Other tool changes include a completely rewritten javac compiler, an IDL compiler (with the name changed from idltojava to idlj) now available with the SDK, and changes to the jar, rmic, jarsigner, and keytool programs.
Sun has tried to keep incompatibilities among Java 2 releases to a minimum. So far there are no clarifications or amendments
to the Java language specification. There are a mere five incompatibilities at the source-code level, only four of which will
require a change in your source code. The one that doesn't require any changes is the hashCode() method of Double. It has been modified to return a value that reflects what the API calls for, to better utilize a HashMap or Hashtable. The remaining three may require source code changes:
javax.swing.Timer class now conflicts with the new java.util.Timer class. If a source file imports from both packages with wildcards (import javax.swing.*; and import java.util.*;) and uses the JFC/Swing Timer class, a compilation error will result. It is necessary to add an import line to directly reference the original Timer class (import javax.swing.Timer;) if you want to keep your code working in the same manner as before.
java.sql.SQLPermission and javax.media.sound.sampled.AudioPermission. With SQLPermission, you need the new permission to change the log writer. If a program tried to change the log writer when running under a version
1.3 runtime environment, the program would fail until the new permission is added. For AudioPermission, previously no permission was necessary to listen to a user's microphone in order to purposely record or eavesdrop. Now you
must have the permission in order for your program to work properly.
JInternalFrame instances. In order to behave more like top-level windows and properly generate events when internal frames open properly,
internal frames are now initially invisible. You'll need to add one line of source code to initially open/show the internal
frame, either internalFrame.show() or internalFrame.setVisible(true).
As with all first beta versions of new "dot point" releases from Sun, the Java 2 SDK, Standard Edition, version 1.3, is definitely not for the deployment of production applications. In fact, the Binary Software Evaluation Agreement you must accept before downloading this version expressly forbids commercial use in clause 3.4 (and even forbids productive use). The SDK is a decent first cut for the public to get a sense of what's coming next. With Internet time pushing increasingly rapid software release cycles, keep in mind that you are trying out very early access beta software. Not everything that is to be added has been implemented yet. If you do evaluate the product, don't forget to let Sun know when you are done using it. According to clause 6.4 in the Binary Software Evaluation Agreement, you must provide written notification that you have completed your evaluation.
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq