0

I would like to know if it is possible to to embed an youtube Iframe in a Java program. I know that you can put html in a JLabel but it didn't work. All I did was

JLabel video = new JLabel("video url here");

So I don't really know what to do. I've checked thisbut it didn't help. Can you even put an iframe in Java?

Thanks a lot.

Community
  • 1
  • 1
DLJ
  • 333
  • 2
  • 6
  • 19

2 Answers2

1

I think the easiest way to do this is to embedd a web browser into the frame using third party libraries, for example you could use JWebBrowser. Here's a good description how to play youtube using JWebBrowser class.

Community
  • 1
  • 1
luke657
  • 826
  • 2
  • 11
  • 28
0

Swing supports html content, but swing controls are not browser analog. May be it will be solution for you: Best Java/Swing browser component?

Community
  • 1
  • 1
Vitalii Pro
  • 313
  • 2
  • 17