Linux 上的 Java:最大化非 Java GUI 应用程序
从Java代码来看,有没有办法最大化不同GUI应用程序的窗口?我可以访问为这些其他程序创建的 Process 对象,以及获取其 PID 的半可靠方法和指示进程二进制文件名称的通用字符串(例如“firefox”)。
如果有某种命令行方式,我还可以以编程方式执行完整的 bash shell 语句(包括与管道连接的命令)。
在 MS Windows 上,我记得在某个地方看到过一个 Java 库,它包装了 win32 窗口 API,允许将那些 Windows 特定的信号传递给应用程序 - 是否有与 Linux 设置类似的东西?如果重要的话,这是针对 Red Hat 系统的。
From Java code, is there a way to maximize the window of a different GUI application? I have access to Process objects created for these other programs, as well as a semi-reliable way to get their PIDs and a generic String indicating the name of the process binary (e.g. "firefox").
I can also programmatically execute full bash shell statements (including commands connected with pipes), if there's some command-line way of going about it.
On MS Windows, I recall seeing somewhere about a Java library that wraps the win32 windowing API, allowing one to pass those Windows-specific signals to applications - would there be something similar to that on a Linux setup? This is for a Red Hat system, if that matters.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是以“基于标准”的方式,不。
X-Windows 系统独立于特定的窗口管理器,因此,没有标准的方法来“最大化”窗口。它最终取决于所使用的窗口管理器的功能...
Not in a "standards-based" way, no.
The X-Windows system is independent of specific window managers, as such, there is no standard way to "maximize" a window. It ultimately depends on the features of the window manager in use...