* Prints the components of a specified Container.
*/
public static void printContainer(Container container, int printingPort, int originX, int originY, Object notifier) {
try {
// obtain a graphics object to draw with.
PrintingPort printer = new PrintingPort(printingPort, originX, originY);
Graphics graphics = printer.getGraphics(container);
// print the specified container.
container.printAll(graphics);
graphics.dispose();
printer.dispose();
} finally {
// if caller is waiting for this to complete, then notify.
if (notifier != null) {
synchronized(notifier) {
notifier.notifyAll();