For instance, the size of the window changed (user resized it), how to get current window size?
Rectangle r = frame.getBounds(); h = r.height; w = r.width;