MacOS Java 6 在全局设置时错误处理 AppleDisplayScaleFactor,并在设置特定于应用程序时完全忽略它
MacOS 的更高版本(> 10.5?)支持一个漂亮的属性,AppleDisplayScaleFactor - 应用程序窗口的比例因子,可以全局设置,也可以为特定应用程序设置(由应用程序的 info.plist 中的 CFBundleIdentifier 标识 - 如我明白了)。
但是...当我在全局范围内使用该值时,我的 Java Swing 应用程序变得一团糟 - 单击与按钮不匹配、屏幕绘制不良等等 - 并且运行 JavaSoundDemo 时也会发生同样的情况。当我尝试以特定于应用程序的方式使用它时,它根本不会被使用(我尝试了应用程序的各种“标识符” - 应用程序的 CFBundleIdentifier、JVM 和 Main 类,用作JVM 窗口的标题)。
我只是希望一些勇敢而聪明的人已经弄清楚如何让它真正发挥作用 - Apple 文档中的“与分辨率无关的显示”声称 Java 可以为您做所有事情。也许这确实应该是向 Apple 提交的错误报告 - 提前致谢。
Later versions of MacOS (> 10.5?) support a spiffy property, AppleDisplayScaleFactor - the scale factor for an application window, which can be set either globally, or for a specific application (identified by the CFBundleIdentifier in the app's info.plist - as I understand it).
BUT... my Java Swing application is a mess when I use this value globally - clicks don't match up with buttons, bad screen painting and so forth - and the same thing happens running JavaSoundDemo. And when I try to use it in a app-specific manner it is never used at all (I tried a variety of "identifiers" for the app - CFBundleIdentifier for the app, for the JVM, and the Main class, which is used as the title for the JVM window).
I'm just hoping that some brave and clever soul has figured out how to make this actually work - the Apple docs on "Resolution-Independent Display" claim that Java simply does everything for you. Perhaps this really should be a bug report to Apple - thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现
AppleDisplayScaleFactor
并不适用于所有应用程序(例如浏览器中的 Flash)。因此,它不能与 Java Swing 一起正常工作并不令我感到惊讶。I've found that
AppleDisplayScaleFactor
doesn't work across all applications (such as Flash within a browser). So it doesn't surprise me that it doesn't work properly with Java Swing.