Heavyweight components have a native window resource attached.
Lightweight ones make use of an ancestor heavyweight component's
native window resource, and rely on Swing to manage the content.
Since VLC is ignorant of any management Swing performs on a native
window resource, it is best to use a heavyweight component dedicated
just to VLC (or any other native application).
If wonderland has problems with heavyweight components, it'll have
problems with anything VLC does as well. You could have it draw to an
offscreen drawable and copy the bits out to a JPanel, but that's
probably a lot more native API than you're willing to get into.
On Apr 14, 2009, at 6:47 AM, Peach Wyss wrote:
Hello
I've tried to use jna (inside jVLC -> java bindings for the vlc
player) with a jpanel:
public void setVideoOutput(JPanel jpanel)
{
long drawable = Native.getComponentID(jpanel);
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_video_set_parent(instance, drawable, exception );
}
Then I get the following error:
Exception in thread "AWT-EventQueue-0"
java.lang.IllegalArgumentException: Component must be heavyweight
at com.sun.jna.Native.getComponentID(Native.java:156)
I had problems using the heavyweight canvas object inside my sun's
wonderland embeddedswing application, so I tried it with a
lightweight jpanel instead of a canvas object. Is it not possible to
use JNA with a lightweight component such as a jpanel?
Thanks for your help.
Peter