Bonjour,
quand j'execute le code j ai un message d'erreur sachant que j ai installe java media framework
aider svp
le message d'erreur
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Access restriction: The type Player is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The type Manager is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
url cannot be resolved
Access restriction: The method addControllerListener(ControllerListener) from the type Controller is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The type ControllerListener is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
The type new ControllerListener(){} must implement the inherited abstract method ControllerListener.controllerUpdate(ControllerEvent)
Access restriction: The type ControllerEvent is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The type RealizeCompleteEvent is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The method getVisualComponent() from the type Player is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The method getControlPanelComponent() from the type Player is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The method start() from the type Player is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
Access restriction: The method realize() from the type Controller is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\ext\jmf.jar
at mp3player.main(mp3player.java:13)
mp3player
import javax.media.*;
import java.io.*;
import java.net.*;
import java.awt.*;
import javax.swing.*;
public class mp3player
{
public static void main(String[] args) throws Exception{
final JFrame f=new JFrame("mp3player");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
File file = new File("C:/Clocks.mp3");
final Player p=Manager.createPlayer(url);
p.addControllerListener(new ControllerListener(){
public void ControllerUpdate(ControllerEvent ce){
if(ce instanceof RealizeCompleteEvent)
{
Component visual=p.getVisualComponent();
Component control=p.getControlPanelComponent();
if(visual !=null)
f.getContentPane().add(visual,"Center");
f.getContentPane().add(visual,"South");
f.pack();
f.setVisible(true);
p.start();
}
}
});
p.realize();
}
}