0

I am using java swing to work on a video player' GUI,but my app needs to call a dll and pass a hwnd to the dll, the dll will draw video frame on the swing component . I know how to do this if the swing component is JFrame, JNA works fine. My problem is that the video play area is just part of the jframe, the area can be any Swing component but JFrame, how can I get its hwnd? I found canvas may work, but I failed to work it out. Any advice? thanks in advance~

  • I doubt it can be made work for general swing components, as they do not have system level handles. Canvas is an AWT component so it *does* have a corresponding native drawing surface. Someone might be able to help if you told what you tried with Canvas. – kiheru Nov 14 '13 at 10:48
  • With up-to-date Java versions, there is (limited) support for mixing lightweight components (like Swing components) and heavy weight components (like `Canvas`). So depending on your setup you may add the `Canvas` to your Swing component tree. – Holger Nov 14 '13 at 10:59
  • thanks for your answers. Now I try to find the handle for canvas.And I found something useful in fmj source code. I will post it if the method actually works – Cheng Zhenyu Nov 14 '13 at 13:44

0 Answers0