gpt4 book ai didi

java - 如何在Java中居中一个窗口?

转载 作者:IT老高 更新时间:2023-10-28 11:23:27 24 4
gpt4 key购买 nike

使 java.awt.Window 居中的最简单方法是什么,例如 JFrameJDialog

最佳答案

来自 this link

If you are using Java 1.4 or newer, you can use the simple method setLocationRelativeTo(null) on the dialog box, frame, or window to center it.

关于java - 如何在Java中居中一个窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/144892/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com