如何通过环境变量或配置文件在 JxBrowser 中禁用 GPU 加速?

How to disable GPU acceleration in JxBrowser via environment variable or config file?

JxBrowser(Vaadin Designer 使用的)无法与我的视频卡驱动程序一起使用,Chromium 也是如此。

使用 --disable-gpu 选项,效果很好。

因为 Vaadin Designer 控制 JxBrowser 生命周期我不能通过命令行传递选项。

如何通过环境变量或config.file将--disable-gpu选项传递给JxBrowser?

谢谢

您可以使用 BrowserPreferences class 的 setChromiumSwitches() 方法来做到这一点。 请看下面的示例:

BrowserPreferences.setChromiumSwitches("--disable-gpu");