This font selector applet works, but we believe it uncovered a Java bug. If you play with this applet for a while, you'll see that not all changes get reflected immediately. Most noticablely, the style selections don't seem to take effect immediately. They only seem to take effect once the name or size values change.

The authors put in a fair amount of debugging (since removed) and even an alternate method of changing the font (still included as "Result2"), but to no avail. Debugging shows that the font is being created with the correct style, but the JLabel seems to ignore it. Our best guess is that Java's font cache thinks it already has the font loaded, but it doesn't. Changing the name or size triggers a refresh of the font cache. This is still a guess, however.

While this is slightly disappointing (we like to have all the answers), this bug is a fairly obscure one and only likely to affect "sample" programs like this one. If we ever get a better answer, we will update these web pages with an answer.