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?

rugelfuss
  • 21
  • 3

1 Answers1

2

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
  • 44,698
  • 7
  • 80
  • 103