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…)