views:

300

answers:

1

I am trying to achieve an effect of transparent JFrame on top of video stream provided JVLC library. Background is an instance of java.awt.Canvas Foreground is my whatever JFrame with a couple of controls on it.

rootPane.setForeground(myFrame); rootPane.setBackground(myCanvas);

JVLC uses my canvas through JNA like this jvlc.setVideoOutput(myCanvas); jvlc.apply();

I expect myFrame to be always transparent to myCanvas. Any ideas how to get this work?

+2  A: 

You can't (reliably) mix lightweight Swing components, such as JPanel, with heavyweight native components, such as Canvas. If you want to display a JPanel, you'll have to add it (ultimately) to a JFrame or a JWindow.

Jonathan Feinberg
Thanks, I have got your point.I will rephrase my question.
rugelfuss