The following method computes the final size of the window setting it so it covers the 90% of the whole screen available space, and then centers it (left-to-right flow):