how to add video in java swing

Solutions on MaxInterview for how to add video in java swing by the best coders in the world

showing results for - "how to add video in java swing"
Lennart
21 Sep 2016
1    public class mediaPlayer extends JFrame
2    {
3        public mediaPlayer()
4        {
5            setLayout(new BorderLayout());
6
7            //file you want to play
8            URL mediaURL = Player mediaPlayer = Manager.createRealizedPlayer(mediaURL);
9            //get components for video and playback controls
10            Component video = mediaPlayer.getVisualComponent();
11            Component controls = mediaPlayer.getControlPanelComponent();
12            add(video,BorderLayout.CENTER);
13            add(controls,BorderLayout.SOUTH);
14        }
15    }