import java.awt.EventQueue;
import java.net.URI;
import javax.swing.JFrame;
import com.sun.media.jmc.*;
public class MediaPlayer extends JFrame
{
public MediaPlayer (String mediaURI)
{
super ("MediaPlayer: "+mediaURI);
setDefaultCloseOperation (EXIT_ON_CLOSE);
JMediaPlayer mp = null;
try
{
mp = new JMediaPlayer (new URI (mediaURI));
}
catch (Exception e)
{
System.out.println ("Error opening media: "+e.toString ());
System.exit (1);
}
setContentPane (mp);
pack ();
setVisible (true);
}
public static void main (final String [] args)
{
if (args.length != 1)
{
System.err.println ("usage: java BMP mediaURI");
return;
}
Runnable r = new Runnable ()
{
public void run ()
{
new MediaPlayer (args [0]);
}
};
EventQueue.invokeLater (r);
}
}
and then i downloaded javafx 1.2 and tried to compile it using
javac -cp jmc.jar MediaPlayer.java (making sure of the file paths)
and i always get the exception that it cannot find the classes JMediaPlayer and URI
what should i do so that i can compile them? and what are these classes subsitutes in the jmc.jar contained in the javafx 1.2? and one more question .. where can i download the javafx 1.0 from because i wasn't able to find it anywhere it was updated to 1.2..
thank you in advance.

New Topic/Question
Reply




MultiQuote


|