Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
JMF Simple Player Applet

JMF Simple Player Applet

Ratings: (0)|Views: 35 |Likes:
Published by Dwij IT Solutions

More info:

Categories:Types, School Work
Published by: Dwij IT Solutions on Feb 14, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

04/09/2013

 
import java.lang.*;import java.net.*;import java.util.*;import java.awt.*;import java.awt.event.*;import java.io.*;import javax.swing.*;import javax.media.*;import javax.media.format.*;import javax.media.protocol.*;class SPA extends JFrame implements ControllerListener{Player player = null;Panel panel = null;String filename;FileDialog fd;Component comp;public void SPA(){setLayout(null);panel = new Panel();panel.setLayout(new FlowLayout());add(panel);panel.setBounds(0, 0, 320, 240);}void play(){try{System.out.println("FileDialog");fd = new FileDialog(this, "Select File", FileDialog.LOAD);fd.show();filename = fd.getDirectory() + fd.getFile();player = Manager.createPlayer(new MediaLocator("file:///" + filename));}catch (Exception e){}player.addControllerListener(this);player.start();}public synchronized void controllerUpdate(ControllerEvent event){if (event instanceof RealizeCompleteEvent){if ((comp = player.getVisualComponent()) != null)add ("Center", comp);if ((comp = player.getControlPanelComponent()) != null)add("South", comp);validate();}}public static void main(String args[])throws Exception{System.out.println("In Start of main");SPA myFrame = new SPA();

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->