Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java on Linux: maximize a non-Java GUI application

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.

like image 659
weiji Avatar asked Mar 15 '26 17:03

weiji


1 Answers

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...

like image 166
maerics Avatar answered Mar 17 '26 07:03

maerics