Java on Linux: maximize a non-Java GUI application

Java on Linux: maximize a non-Java GUI application … here is a solution to the problem.

Java on Linux: maximize a non-Java GUI application

In Java code, is there a way to maximize the windows of different GUI applications? I have access to Process objects created for these other programs, as well as semi-reliable methods for getting their PIDs and generic strings (e.g. “firefox”) that indicate the name of the process binary.

If I have some command line modality, I can also programmatically execute full bash shell statements (including commands connected to the pipe).

On MS Windows, I remember seeing a Java library somewhere that wrapped the win32 window API to allow those Windows-specific signals to be passed to the application – would there be anything like that on a Linux setup? If important, this is for the Red Hat system.

Solution

Not in a “standards-based” way, no.

The X-Windows system is independent of a particular window manager, so there is no standard way to “maximize” a window. This ultimately depends on the characteristics of window manager in use….

Related Problems and Solutions