fleurette
-
Modifié par jee pee le 2/11/2013 à 18:34
KX
Messages postés16739Date d'inscriptionsamedi 31 mai 2008StatutModérateurDernière intervention19 mai 2024
-
2 nov. 2013 à 18:38
Bonjour,
j'ai un programme sur J2ME qui prend des captures d'images à partir d'une vidéo en cours de lecture
ça marchait au début, sur le pc de l'école mais sur mon pc ça tourne pas.
voici le code
public class CameraMIDlet extends MIDlet implements CommandListener {
private Display display; private Form form,form2; private Command exit,back,capture,camera; private Player player; private VideoControl videoControl; private Video video;
public CameraMIDlet() {
exit = new Command("Exit", Command.EXIT, 0); camera = new Command("Camera", Command.SCREEN, 0); back = new Command("Back", Command.BACK, 0); capture = new Command("Capture", Command.SCREEN, 0); form2 = new Form("Play video");
form = new Form("Capture Video"); form.addCommand(camera); form.setCommandListener(this); }
public void startApp() { display = Display.getDisplay(this); Process process = new Process(this); process.start(); }
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) { if (c == exit) { destroyApp(true); notifyDestroyed(); } else if (c == camera) { display.setCurrent(form2); } else if (c == back) display.setCurrent(form); else if (c == capture) { video = new Video(this); video.start(); } } class Process implements Runnable { private CameraMIDlet MIDlet;
public Process(CameraMIDlet MIDlet) { this.MIDlet = MIDlet; }
public void run() { try { player = Manager.createPlayer("http://localhost/midp/shark.mpg"); // "capture://video" is used for S60 devices //player = Manager.createPlayer("capture://image"); // "capture://image" is used for Series 40 devices player.realize();
ça me génère une erreur
" Unable to create MIDlet CameraMIDlet
java.lang.ClassNotFoundException: CameraMIDlet
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Selector.run(+22)
"
est ce qu'il ya quelqu'un qui puisse m'aider ?
merci
KX
Messages postés16739Date d'inscriptionsamedi 31 mai 2008StatutModérateurDernière intervention19 mai 2024127 2 nov. 2013 à 18:38
Le package com.sun.midp.midlet.* ne fait pas partie des bibliothèques standards, tu dois l'ajouter explicitement pour que cela fonctionne. Il faut donc que tu récupères le même jar que celui configuré sur ton pc à l'école.
2 nov. 2013 à 18:38