相关疑难解决方法(0)

屏幕右下角的位置

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

java swing point jframe layout-manager

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

java ×1

jframe ×1

layout-manager ×1

point ×1

swing ×1