Frame Z-order in Java?

Thursday, July 13th, 2006

I must be missing something obvious. Is there a method anywhere in the AWT (preferably in Java 1.4 but maybe 1.5) that allows me to determine the z-order, relative or absolute, of free-standing windows such as frames and dialogs? Specifically I need to know which of several dozen frames is on top among that group. To make this trickier:

  1. There may be other frames and dialogs that do not count. For instance, if the preferences dialog is really on top, I still need to know which of my application’s document windows is on top among the document windows.
  2. I need to know this even when the application is in the background, so that the top window may not be active.

Surely there’s a function for this somewhere? If not, it’s a pretty glaring hole. Do I really have to write code to watch each and every operation that can move a frame to the front, and track the front window manually?

Copying files from one JAR to another using ANT

Friday, July 7th, 2006

To avoid needless duplication of source files in two different repositories, I would like to write an Ant build.xml file that copies files from one .jar file to another. I don’t want to copy everything in the source jar, just certain selected files.
(more…)

The Elements of C# Style

Friday, June 30th, 2006

What’s the best book discussing the proper writing of .NET code in general and C# in particular? I’m thinking of something along the lines of Joshua Bloch’s Effective Java, but for C# instead of Java. That is, I want a book that assumes I already know the basic mechanics of the language, and am quite familiar with general object oriented principles like polymorphism, but need to know things such as “classes begin with lower case letters and methods begin with upper case letters.”

Here are a few possibilities:
(more…)

The Problem with Gill Sans

Thursday, June 29th, 2006

1've decided that as pretty as Gill Sans is, it’s not going to work. On rereading an older post in the new font, 1 noticed a major flaw in its design that makes it unsuitable for production use. 1f you’re reading this post in Gill Sans, you may want to switch your font to see what 1'm talking about. 1f you’re reading it in another font, doubtless you’ve already noticed the problem.

(more…)

Steal This Font

Tuesday, June 27th, 2006

I was so taken by the clean look of Mark Pilgrim’s latest blog entry that I just had to look at his stylesheet, and figure out what font he was using. It seems to be Gill Sans at a large size. I’ve now revamped this site to use that as its body font. (Optima is the backup for those deprived PCs without Gill Sans installed.)

On the other hand, he’s using 180% line height which looked a little too big to me, so I’ve set the line height at 140%.

I still need to play with the heading, sidebar, and comment fonts so they match–maybe I should just steal Mark’s choices for these too–but overall this font feels quite a bit more readable and modern to me.

Extreme Recruiting

Tuesday, June 27th, 2006

Today I got an e-mail seeking an “XP developer” (in a context where XP obviously stood for Extreme Programming, not Windows XP). What was unusual was that I had to read halfway through the message to find out that they wanted a C#/.NET developer. The first half talked only about XP, Scrum, and Agile techniques.

It’s an interesting inversion of the typical job ad. Normally the programming language is right up top and the methodology is an afterthought, if it’s included at all. Nonetheless, I think these folks got it right. It might well be easier to take a solid Java practitioner of extreme programming and integrate him or her into a .NET XP shop, than it would be to take a .NET person who’d never done XP, and bring them in. On-the-fly training is an oft-forgotten and underrated benefit of both pair programming and test-first development.