Similar to the question at Closing video window using close "X" button in OpenCV, Python, is there a way to close a Video window with the X button using Java? Need solution for both Windows and Linux.
The Java version doesn't seem to have a getWindowsProperty() method anywhere.
Update I was not clear that I am trying to use HighGui.imshow(), which unfortunately, does not expose the JFrame to add a listener to it. See openCv 4 Java HighGui.imshow