当我将 java swing 应用程序拖到 Windows 7 屏幕的上角时,它会填满整个屏幕。有什么办法可以保持尺寸不变吗?
最佳答案
希望您正在谈论您的 JFrame 并且您可以使用框架。 setMaximizedBounds(). 正如 javadoc 所说,
Sets the maximized bounds for this frame.
When a frame is in maximized state the system supplies some defaults bounds. This method allows some or all of those system supplied values to be overridden.
Note, the given maximized bounds are used as a hint for the native system, because the underlying platform may not support setting the location and/or size of the maximized windows. If that is the case, the provided values do not affect the appearance of the frame in the maximized state.
关于Windows 7 中的 Java swing 最大化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8767749/