For instance, the size of the window changed (user resized it), how to get current window size?
Simply use the getSize()method: javadoc
getSize()