我需要在屏幕上放置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