question: public void centerDialog ( ) { final Toolkit toolkit = Toolkit . getDefaultToolkit ( ) ; final Dimension screenSize = toolkit . getScreenSize ( ) ; final int x = ( screenSize . width - getWidth ( ) ) / 2 ; final int y = ( screenSize . height - getHeight ( ) ) / 2 ; setLocation ( x , y ) ; }
target:  Center the dialog on the screen.