Just for future reference, if I see a font named “Elephant”, I won’t just assume that it’s a great programming font.
Yep, that's hideous. But it could have something to do with the two anonymous inner classes within 10 lines of code. Shouldn't that clear action code be in its own method, so menus/toolbars/test harnesses can drive it too? And what do you think you're doing overriding paint() in a Swing component? Surely you know it's meant to be paintComponent()! If you were using a modern jdk (1.5 or higher), you could even pass -Dswing.aatext=true on the commmand line, and avoid the override altogether. Java 6 (or 1.6, depending on how strongly you're attached to that 1. prefix, aka Mustang) will finally match its aliasing mode to the OS, eliminating the need for even this meagre flag.
Back to the font at hand, the fact that it's shown up as bold isn't helping its case. Perhaps it wouldn't look so bad if there were some comments in the vicinity? I have a feeling this font is best when there is a reasonable amount of text on screen (as is typically seen in a javadoc comment), and not as much bracket goop. Of course, it's hard to make semantics free code such as this look good :)
The font does have benefits for those who still like their fonts seriffed, and their text widths natural. The monospaced arial lovers (is there a font like this around?) however will never succumb to this font's wiles.
[PS: What time is it on this server? Did it forget to put it's clock back when daylight saving started?]
Oh yes, it is hideous. Fortunately, the code only lasted about five minutes before I couldn't stand the thought of it and rewrote it. I saved a copy of it though, as it will make a good interview question one day.
Didn't know about the swing.aatext flag. Thankyou for the pointer.
FYI, Microsoft at one stage provided a monospaced sanserif font called Andale Mono (aka Monotype.com). You can get it from them (for $30, from http://www.microsoft.com/typography/fonts/font.aspx?FID=11&FNAME=Andale%20Mono), or from the Core Fonts project (http://corefonts.sourceforge.net/, and legally free-as-in-beer according to the EULA that MS attached), which also has some packages for use under linux.
Could you by an chance mail me the font, I have been looking for it for a while. Thank you
Sorry Anderes, it's an MS font, and the license conditions forbid sharing it 'round. However, if you buy MS Office, you get it "for free".