JDK-8218009 : Release Note: GraphicsEnvironment.getCenterPoint() and getMaximumWindowBounds() are Unified Across Platforms
  • Type: Sub-task
  • Component: client-libs
  • Affected Version: 13
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-01-29
  • Updated: 2019-08-09
  • Resolved: 2019-01-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13Resolved
Description
Two methods were added to the `GraphicsEnvironment` class in JDK 1.4:
 - `getCenterPoint()`
 - `getMaximumWindowBounds()` 

See [https://docs.oracle.com/javase/7/docs/technotes/guides/awt/1.4/AWTChanges.html#windowCentering](https://docs.oracle.com/javase/7/docs/technotes/guides/awt/1.4/AWTChanges.html#windowCentering).

The page in the preceding link includes the following description:

"X-Window, Xinerama
All monitors share a single virtual coordinate space, as on Microsoft Windows. However, it is possible for the user to specify through X resources where windows should be centered. If these resources are set, `getCenterPoint` reflects their value. Otherwise, it returns the point at the center of the virtual coordinate space. (In practice, this will almost always be set - CDE sets it by default.)"

Now, in JDK 13, the implementation of  `getCenterPoint()` and `getMaximumWindowBounds()` has been unified across the platforms (Windows, Linux, Solaris, and macOS):
 - `getCenterPoint` returns the coordinates of the center of the primary display, for all platforms.
 - `getMaximumWindowBounds` returns the bounds of the primary display minus display insets, for all platforms.