Getting the Hwnd or Xid in JDK 21+
In modern versions of Java, it has became increasingly difficult to get the HWND or Xid of a Swing component. This is because of the encapsulation of the native peer in the Component class, as well as the module encapsulation changes introduced in Java 9.
Old methods of getting the