Java Genesis
Hints for Chapter 9: Graphics and Event Handling
Problem 2: centring a window
The simplest way to create a window whose area is 1/4 that of the screen
is to set its width to be 1/2 that of the screen's width and its height
1/2 that of the screen height. Try this before looking at the next hint.
Next Hint