};
f.getContentPane().add(child);
f.setVisible(true);// technically, this statement should be in the sync block, but that only works on the Sun JVM..
synchronized(vars) {
try {
vars.wait(1000); // wait until it has been painted, for max of 1 sec.
} catch(InterruptedException e) {
// fail
} finally {
w = f.getContentPane().getWidth();
h = f.getContentPane().getHeight();