解决方法
假设您不想掩盖任务栏,则应使用getMaximumWindowBounds.
@H_502_2@Java API
@H_502_2@http://www.javabeginner.com/java-swing/java-jframe-class-example
@H_502_2@Centering JFrame’s @H_502_2@By default,a Jframe is displayed in@H_502_2@右上角的伪代码看起来像这样:
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);