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
I was dismayed when several simple Java 2D applications I was developing for my new Media Programming column took not seconds but several minutes to start up and paint a simple Frame. My search for an explanation and workaround in the JDK documentation on the Sun product page (see Resources) and in the JDK 1.2 Beta 3 README was in vain.
After that, and several unproductive e-mails to friends and associates, I made a startling discovery: There is a known performance problem in the JDK 1.2 Beta 3 for Windows involving fonts. This problem has a relatively easy workaround, but neither problem nor solution are mentioned anywhere on the main JDK 1.2 product page.
My salvation came in the form of a post to the Java Developer Connection (see Resources for the URL of this post). The post explained that JDK 1.2 Beta 3 is in fact many times slower (potentially hundreds of times slower) at start-up than the previous 1.2 Beta 2. JDK 1.2 Beta 3 for Windows NT/95 attempts to load every font in the Windows font directory (on my Windows 95 system, this is C:\Windows\Fonts) before starting your actual Java application. This in spite of the fact that most applications don't need anything but the default fonts and make no special use of Java font support. This is a nasty bug, and if you need to use 1.2 Beta 3, it's one you'll definitely want to work around.
The JDK 1.2 Beta 3 workaround is relatively simple. First, you should copy the four required True Type fonts (Arial.ttf, Cour.ttf, Times.ttf, and Wingding.ttf) from your Windows font directory into a new directory of your choice. I chose to create a directory under my JDK 1.2 Beta 3 installation:
C:\jdk1.2beta3\Fonts
Note that it's important that you copy the fonts rather than simply moving them. This is so that your other, well-behaved Windows applications can still use these fonts.
Next, you need to instruct your Java tools and runtime to use the new font directory instead of the system default. You do this by setting the JAVA_FONTS environment variable in your autoexec.bat to point to your new fonts directory. For example, for my installation, I set this as:
SET JAVA_FONTS=C:\jdk1.2beta3\Fonts
Now, execute your autoexec.bat and you should see your Java apps start up with amazing speed, relative to JDK 1.2 Beta 3 without this workaround. The more fonts you have in your Windows font directory, the greater the difference in speed.
Try a before and after comparison. I promise you'll be amazed that this bug slipped by Sun's test-and-release engineering team!
Waiting a long time for a program to start up is a frustrating experience. This tip helps remove the slow start-up time -- a major and unnecessary barrier to your use of the JDK beta release. Let's all hope Sun fixes this bug in Beta 4.
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