2010-03-02 6 views
1

J'ai trouvé un code sur internet mais vraiment je ne sais pas ce que pour ces exceptions, merci de m'aider vraiment j'ai besoin de ton aide merci.code 3D simple qui jette l'exception!

run: 
java.lang.UnsupportedOperationException: No AudioDevice specified 
     at com.sun.j3d.utils.universe.Viewer.createAudioDevice(Viewer.java:986) 
     at javaapplication17.WrapShooter3D.<init>(WrapShooter3D.java:54) 
     at javaapplication17.Shooter3D.<init>(Shooter3D.java:25) 
     at javaapplication17.Shooter3D.main(Shooter3D.java:38) 
    Java 3D: audio is disabled 
    Exception in thread "main" com.sun.j3d.utils.image.ImageException: javax.imageio.IIOException: Can't read input file! 
     at com.sun.j3d.utils.image.TextureLoader$1.run(TextureLoader.java:344) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at com.sun.j3d.utils.image.TextureLoader.<init>(TextureLoader.java:337) 
     at com.sun.j3d.utils.image.TextureLoader.<init>(TextureLoader.java:291) 
     at javaapplication17.GunTurret.stoneApp(GunTurret.java:58) 
     at javaapplication17.GunTurret.<init>(GunTurret.java:43) 
     at javaapplication17.WrapShooter3D.makeGun(WrapShooter3D.java:167) 
     at javaapplication17.WrapShooter3D.createSceneGraph(WrapShooter3D.java:79) 
     at javaapplication17.WrapShooter3D.<init>(WrapShooter3D.java:56) 
     at javaapplication17.Shooter3D.<init>(Shooter3D.java:25) 
     at javaapplication17.Shooter3D.main(Shooter3D.java:38) 
    Caused by: javax.imageio.IIOException: Can't read input file! 
     at javax.imageio.ImageIO.read(ImageIO.java:1275) 
     at com.sun.j3d.utils.image.TextureLoader$1.run(TextureLoader.java:342) 
     ... 10 more 

_ java.lang.UnsupportedOperationException: Non spécifié AudioDevice

aux lignes:

AudioDevice audioDev = su.getViewer().createAudioDevice(); 
    WrapShooter3D w3d = new WrapShooter3D(); 
    javax.imageio.IIOException: Can't read input file! 
    { new Shooter3D(); } 

_ Java 3D: audio est désactivé Exception dans le thread "principal" com.sun.j3d .utils.image.ImageException:

aux lignes:

TextureLoader stoneTex = new TextureLoader("images/stone.jpg", null); 
Appearance apStone = stoneApp(); 
GunTurret gun = new GunTurret(startVec); 
makeGun(canvas3D); 
createSceneGraph(canvas3D); 
WrapShooter3D w3d = new WrapShooter3D(); 
{ new Shooter3D(); } 

_ Causé par: javax.imageio.IIOException: Impossible de lire le fichier d'entrée!

unter:

throw new IIOException("Can't read input file!"); 
+0

Êtes-vous sûr que le fichier stone.jpg est disponible au même endroit que mentionné? Vous pourriez vouloir essayer le chemin absolu une fois. – vpram86

+0

J'ai créé une application java qui dans ses paquets source a 3 paquet (images/sons/javaapplication17) – Johanna

Répondre

1

TextureLoader Stonetex = new TextureLoader ("images/stone.jpg", NULL);

Essayez de remplacer "images/stone.jpg" par le chemin d'accès complet au fichier. Par exemple. "c: \ abc \ efg \ images \ pierre.jpg".