Maximizing a window in a multi-screen environment
843804Feb 14 2005 — edited Oct 29 2007Hello.
I am developing a Java application which should work in a multi-monitor environment. In particular, I have a main JFrame that, when maximized, should span across all available monitors (typically, two monitors in a "one row" configuration).
The standard JFrame maximization only maximizes the JFrame on one monitor.
How to maximize the JFrame across all monitors? I've already iterated through the GraphicsEnvironment, GraphicsDevice and GraphicsConfiguration objects, and I am able to obtain the total size of the complete "virtual" desktop: but if I call the "setSize()" method and set the size of the JFrame equal to the size of the virtual desktop, then my JFrame will span across all monitors, but the status (i.e., the extended state) of my frame is not "maximized" (I still see the top right icon to maximize the frame). Not to mention that I have to keep into account the size and position of the Windows takbar...
Can you suggest a "clean" way to obtain a complete "multi-monitor" maximization of a JFrame?
Any help would be greatly appreciated.
Regards,
Marco.