我需要在屏幕上放置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);
Run Code Online (Sandbox Code Playgroud)