我需要在屏幕上放置JFrame。但是我不能让它们出现在屏幕底部的右侧。屏幕右下角的位置
请有人能解释我如何定位他们,如果你能描述如何去做,那会很棒。
这是目前为止的代码。
//Gets the screen size and positions the frame left bottom of the screen
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice defaultScreen = ge.getDefaultScreenDevice();
Rectangle rect = defaultScreen.getDefaultConfiguration().getBounds();
int x = (int)rect.getMinX();
int y = (int)rect.getMaxY()- frame.getHeight();
frame.setLocation(x ,y - 45);
有些平台限制了这一点,如[这里](http://stackoverflow.com/a/2188981/230513)所述。 – trashgod 2012-03-17 22:04:54