Windows 7 中的 Java swing 最大化

标签 java swing windows-7

当我将 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/

相关文章:

java - 通过递归解决此问题的任何其他更短的方法

java - jtextpane 突出显示仅突出显示第一个实例

c++ - 异步WinBioVerify与WinBioVerifyWithCallback

delphi - Windows 7 上 WTSOpenServer 发生奇怪崩溃(仅在 Delphi 2009/2010 中)

Java - Desktop.open() 无法打开视频或音乐

Java 字符串导入

java - 在哪里添加 do while 循环以使程序重复或终止?

java - 使用 HttpUrlConnection 将 JSONArray 发布到服务器

java - 从外部类更改 TabbedPane 索引

Java,FileWriter(file, true) 不追加到文件上