title: Closing video window using close “X” button in OpenCV with Java
body: <p>Similar to the question at <a href="https://stackoverflow.com/questions/13307606/closing-video-window-using-close-x-button-in-opencv-python/63256721?noredirect=1#comment119094035_63256721">Closing video window using close &quot;X&quot; button in OpenCV, Python</a>, is there a way to close a Video window with the X button using Java?  Need solution for both Windows and Linux.</p>
  <p>The Java version doesn't seem to have a getWindowsProperty() method anywhere.</p>
  <p><strong>Update</strong>
  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 <a href="https://stackoverflow.com/questions/54103815/opencv-4-java-highgui-imshow">openCv 4 Java HighGui.imshow</a></p>