解决方法
假设您不想掩盖任务栏,则应使用getMaximumWindowBounds.
http://www.javabeginner.com/java-swing/java-jframe-class-example
Centering JFrame’s
By default,a Jframe is displayed in
the upper-left corner of the screen.
To display a frame at a specified
location,you can use the
setLocation(x,y) method in the JFrame
class. This method places the
upper-left corner of a frame at
location (x,y).
右上角的伪代码看起来像这样:
yourJFrame.setLocation( GraphicsEnvironment.getMaximumWindowBounds().getWidth() - yourJFrame.getWidth(),0);