Trying to embed vlcj media player in a WindowsCanvas inside a JPanel
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to play a video using vlcj inside a JPanel but it doesn't work for me. The message exception I am getting is "java.lang.IllegalStateException: The video surface component must be displayable" which is the same problem as in Keep getting an Error "Component must be displayable" . The code of the JPanel which contains the canvas and the vlcj player is this: import javax.swing.JPanel; import com.sun.jna.Native; import com.sun.jna.NativeLibrary; import java.awt.Canvas; import java.awt.Color; import uk.co.caprica.vlcj.binding.LibVlc;