Tag: point

屏幕右下角的位置

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