Posez votre question Signaler

Mp3 java

Hacker#1 68Messages postés 6 janvier 2009Date d'inscription 20 avril 2010Dernière intervention
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();
}
}
Lire la suite 

Mp3 java »

Ce document intitulé « mp3 java » issu de CommentCaMarche (www.commentcamarche.net) est mis à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de cette page, dans les conditions fixées par la licence, tant que cette note apparaît clairement.
Dossier à la une
5 extensions si vous voulez revenir à l'ancien Facebook