Ouverture d'un dossier

Résolu
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012 - 17 juil. 2012 à 13:49
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 - 25 juil. 2012 à 10:56
Bonjour,

je suis actuellement en stage, on m'a donner l'interface du DVD de l'entreprise à refaire.
J'ai déjà fait la fenêtre, le menu, et les ActionListener des boutons.

Mais voila, petit problème sur un des Listener, je voudrais ouvrir un dossier mais ça ne marche pas... aucune erreur de compilation mais lorsque je clic sur le bouton censé ouvrir ce dossier, j'ai le message d'erreur suivant :
Erreur d'ouverture:java.io.FileNotFoundException: C:\Users\Thomas\Desktop\DVD 3A INFORMATIQUE (Accès refusé)


J'utilise la méthode suivante :
if(source == jButton3){
BufferedReader BR = null;
try {
BR = new BufferedReader(new FileReader("C://Users//Thomas//Desktop//DVD 3A INFORMATIQUE"));
}
catch (Exception exc) {
            System.out.println("Erreur d'ouverture:"+exc);
}
        }


Si quelqu'un pouvait m'éclairer sur ce problème, merci :)

46 réponses

Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
18 juil. 2012 à 11:48
Qui me pose encore un autre problême, j'suis relou je sais, une fois mon programme au format .jar pour le graver sur un DVD, le chemin de dossier ne sera plus le bon n'est ce pas ?
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
18 juil. 2012 à 12:29
Re,

Si tu ne vois pas les fichiers, c'est parce que tu as mis DIRECTORIES_ONLY.
Au final, il y a peut-être un malentendu. Qu'est-ce que l'utilisateur doit sélectionner avec ce JFileChooser : un fichier ou un dossier ?

Autre chose, le bout de code suivant ne peut évidemment par s'exécuter (NullPointerException) :

JFileChooser jfc = null;
File se = jfc.getSelectedFile();


Pour le jar, il n'y a pas de souci : si le chemin existe ça va marcher (enfin, là avec un chemin pareil, ça ne marchera que sur ton ordinateur). Il est préférable de ne pas spécifier le dossier (ou alors tu le mets dans un fichier de propriétés).

Dernière chose, il est possible de personnaliser le JFileChooser, pour afficher moins de composants.
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
18 juil. 2012 à 13:13
Alors, l'utilisateur doit sélectionner un fichier, un .exe pour être exact en passant par différents dossiers !



Code Java :

JFileChooser jfc = null;
File se = jfc.getSelectedFile();



J'ai rajouter cette ligne de code pour enlever l'erreur d'Eclispe sur le "jfc".

Pour le jar, il n'y a pas de souci : si le chemin existe ça va marcher (enfin, là avec un chemin pareil, ça ne marchera que sur ton ordinateur). Il est préférable de ne pas spécifier le dossier (ou alors tu le mets dans un fichier de propriétés).

Je travail avec un dossier contenant tout ce dont j'ai besoin pour le DVD qui est sur le bureau, si je change le lien par :
choix.setCurrentDirectory(new File("../DVD 3A INFORMATIQUE/200 logiciels"));

le problème sera t-il réglait ?

Et enfin, concernant les composants de JFileChosse, je n'est trouver que des tutoriels, très compliqué d'ailleur, permettant de le créer mais pas de la modifier

merci pour ton aide !
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
18 juil. 2012 à 13:24
Alors, j'ai supprimer l'initialisation de jfc et je les remplacer par :
private JFileChooser jfc;


De même, j'ai supprimer la ligne :
choix.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);


Je vois maintenant les .exe, mais qund je clic dessus pour lancer l'intallation du logiciel en question, j'ai plusieurs erreurs :
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Pour finir, j'ai remplacer le lien par :
choix.setCurrentDirectory(new File("../DVD 3A INFORMATIQUE/200 logiciels"));

ça marche toujours mais je ne tombe plus directement sur le dossier !!
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
20 juil. 2012 à 07:48
Bonjour,

personnes peux m'aider pour se problème de .exe non reconnu svp ?
ps : les .exe marche comme il faut, il sont bien dans le dossier, c'est juste avec le JFileChooser qu'il ne sont pas reconnu.
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
20 juil. 2012 à 09:04
Pour commencer, ceci :

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


n'est pas "plusieurs exceptions", ça s'appelle une trace de pile (stacktrace), sauf qu'il en manque la moitié. Notamment, les premières lignes qui sont les plus importantes. Peux-tu nous la donner en entier stp ?
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 08:31
Salut,

petit Week-End de repos, réponse tardive désolé.

Alors, je te donne tout ce qui est écrit depuis le début, lorsque je lance un jfc :
10:12.35 1[dbg] In DllGetClassObject
10:12.35 2[dbg] CShellExtClassFactory::CShellExtClassFactory()
10:12.35 3[dbg] CShellExtClassFactory::QueryInterface()
10:12.35 4[dbg] CShellExtClassFactory::CreateInstance()
10:12.35 5[dbg] CShellExt::CShellExt()
10:12.35 6[dbg] Looping before Zumo is running
10:12.35 7[dbg] Drive not mounted
10:12.35 8[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 9[dbg] CShellExt::AddRef()
10:12.35 10[dbg] CShellExt::AddRef()
10:12.35 11[dbg] CShellExt::Release()
10:12.35 12[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 13[dbg] CShellExt::AddRef()
10:12.35 14[dbg] CShellExt::Release()
10:12.35 15[dbg] Entering CShellExt::GetOverlayInfo
10:12.35 16[dbg] Icon path: C:\Program Files (x86)\Hewlett-Packard\HP CloudDrive\icons\deflated.ico
10:12.35 17[dbg] Exiting CShellExt::GetOverlayInfo successfully.
10:12.35 18[dbg] Time to execute: 0ms
10:12.35 19[dbg] Entering CShellExt::GetPriority
10:12.35 20[dbg] Exiting CShellExt::GetPriority
10:12.35 21[dbg] In DllGetClassObject
10:12.35 22[dbg] CShellExtClassFactory::CShellExtClassFactory()
10:12.35 23[dbg] CShellExtClassFactory::QueryInterface()
10:12.35 24[dbg] CShellExtClassFactory::CreateInstance()
10:12.35 25[dbg] CShellExt::CShellExt()
10:12.35 26[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 27[dbg] CShellExt::AddRef()
10:12.35 28[dbg] CShellExt::AddRef()
10:12.35 29[dbg] CShellExt::Release()
10:12.35 30[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 31[dbg] CShellExt::AddRef()
10:12.35 32[dbg] CShellExt::Release()
10:12.35 33[dbg] Entering CShellExt::GetOverlayInfo
10:12.35 34[dbg] Icon path: C:\Program Files (x86)\Hewlett-Packard\HP CloudDrive\icons\download.ico
10:12.35 35[dbg] Exiting CShellExt::GetOverlayInfo successfully.
10:12.35 36[dbg] Time to execute: 0ms
10:12.35 37[dbg] Entering CShellExt::GetPriority
10:12.35 38[dbg] Exiting CShellExt::GetPriority
10:12.35 39[dbg] In DllGetClassObject
10:12.35 40[dbg] CShellExtClassFactory::CShellExtClassFactory()
10:12.35 41[dbg] CShellExtClassFactory::QueryInterface()
10:12.35 42[dbg] CShellExtClassFactory::CreateInstance()
10:12.35 43[dbg] CShellExt::CShellExt()
10:12.35 44[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 45[dbg] CShellExt::AddRef()
10:12.35 46[dbg] CShellExt::AddRef()
10:12.35 47[dbg] CShellExt::Release()
10:12.35 48[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 49[dbg] CShellExt::AddRef()
10:12.35 50[dbg] CShellExt::Release()
10:12.35 51[dbg] Entering CShellExt::GetOverlayInfo
10:12.35 52[dbg] Icon path: C:\Program Files (x86)\Hewlett-Packard\HP CloudDrive\icons\share.ico
10:12.35 53[dbg] Exiting CShellExt::GetOverlayInfo successfully.
10:12.35 54[dbg] Time to execute: 0ms
10:12.35 55[dbg] Entering CShellExt::GetPriority
10:12.35 56[dbg] Exiting CShellExt::GetPriority
10:12.35 57[dbg] In DllGetClassObject
10:12.35 58[dbg] CShellExtClassFactory::CShellExtClassFactory()
10:12.35 59[dbg] CShellExtClassFactory::QueryInterface()
10:12.35 60[dbg] CShellExtClassFactory::CreateInstance()
10:12.35 61[dbg] CShellExt::CShellExt()
10:12.35 62[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 63[dbg] CShellExt::AddRef()
10:12.35 64[dbg] CShellExt::AddRef()
10:12.35 65[dbg] CShellExt::Release()
10:12.35 66[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 67[dbg] CShellExt::AddRef()
10:12.35 68[dbg] CShellExt::Release()
10:12.35 69[dbg] Entering CShellExt::GetOverlayInfo
10:12.35 70[dbg] Icon path: C:\Program Files (x86)\Hewlett-Packard\HP CloudDrive\icons\upload.ico
10:12.35 71[dbg] Exiting CShellExt::GetOverlayInfo successfully.
10:12.35 72[dbg] Time to execute: 0ms
10:12.35 73[dbg] Entering CShellExt::GetPriority
10:12.35 74[dbg] Exiting CShellExt::GetPriority
10:12.35 75[dbg] In DllGetClassObject
10:12.35 76[dbg] CShellExtClassFactory::CShellExtClassFactory()
10:12.35 77[dbg] CShellExtClassFactory::QueryInterface()
10:12.35 78[dbg] CShellExtClassFactory::CreateInstance()
10:12.35 79[dbg] CShellExt::CShellExt()
10:12.35 80[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 81[dbg] CShellExt::AddRef()
10:12.35 82[dbg] CShellExt::AddRef()
10:12.35 83[dbg] CShellExt::Release()
10:12.35 84[dbg] CShellExt::QueryInterface()==>IID_IShellIconOverlayIdentifier
10:12.35 85[dbg] CShellExt::AddRef()
10:12.35 86[dbg] CShellExt::Release()
10:12.35 87[dbg] Entering CShellExt::GetOverlayInfo
10:12.35 88[dbg] Icon path: C:\Program Files (x86)\Hewlett-Packard\HP CloudDrive\icons\fw.ico
10:12.35 89[dbg] Exiting CShellExt::GetOverlayInfo successfully.
10:12.35 90[dbg] Time to execute: 0ms
10:12.35 91[dbg] Entering CShellExt::GetPriority
10:12.35 92[dbg] Exiting CShellExt::GetPriority
10:12.40 93[dbg] Looping before Zumo is running
10:12.40 94[dbg] Drive not mounted
10:12.45 95[dbg] Looping before Zumo is running
10:12.45 96[dbg] Drive not mounted
10:12.50 97[dbg] Looping before Zumo is running
10:12.50 98[dbg] Drive not mounted
10:12.55 99[dbg] Looping before Zumo is running
10:12.55 100[dbg] Drive not mounted
10:13.00 101[dbg] Looping before Zumo is running
10:13.00 102[dbg] Drive not mounted
10:13.05 103[dbg] Looping before Zumo is running
10:13.05 104[dbg] Drive not mounted
10:13.10 105[dbg] Looping before Zumo is running
10:13.10 106[dbg] Drive not mounted
10:13.15 107[dbg] Looping before Zumo is running
10:13.15 108[dbg] Drive not mounted
10:13.20 109[dbg] Looping before Zumo is running
10:13.20 110[dbg] Drive not mounted
10:13.25 111[dbg] Looping before Zumo is running
10:13.25 112[dbg] Drive not mounted
10:13.30 113[dbg] Looping before Zumo is running
10:13.30 114[dbg] Drive not mounted
10:13.35 115[dbg] Looping before Zumo is running
10:13.35 116[dbg] Drive not mounted
10:13.40 117[dbg] Looping before Zumo is running
10:13.40 118[dbg] Drive not mounted
10:13.45 119[dbg] Looping before Zumo is running
10:13.45 120[dbg] Drive not mounted
10:13.50 121[dbg] Looping before Zumo is running
10:13.50 122[dbg] Drive not mounted
10:13.55 123[dbg] Looping before Zumo is running
10:13.55 124[dbg] Drive not mounted
10:14.00 125[dbg] Looping before Zumo is running
10:14.00 126[dbg] Drive not mounted
10:14.05 127[dbg] Looping before Zumo is running
10:14.05 128[dbg] Drive not mounted
10:14.10 129[dbg] Looping before Zumo is running
10:14.10 130[dbg] Drive not mounted
10:14.15 131[dbg] Looping before Zumo is running
10:14.15 132[dbg] Drive not mounted
10:14.20 133[dbg] Looping before Zumo is running
10:14.20 134[dbg] Drive not mounted
10:14.25 135[dbg] Looping before Zumo is running
10:14.25 136[dbg] Drive not mounted
10:14.30 137[dbg] Looping before Zumo is running
10:14.30 138[dbg] Drive not mounted
10:14.35 139[dbg] Looping before Zumo is running
10:14.35 140[dbg] Drive not mounted
10:14.40 141[dbg] Looping before Zumo is running
10:14.40 142[dbg] Drive not mounted
10:14.45 143[dbg] Looping before Zumo is running
10:14.45 144[dbg] Drive not mounted
10:14.50 145[dbg] Looping before Zumo is running
10:14.50 146[dbg] Drive not mounted
10:14.55 147[dbg] Looping before Zumo is running
10:14.55 148[dbg] Drive not mounted
10:15.00 149[dbg] Looping before Zumo is running
10:15.00 150[dbg] Drive not mounted
10:15.05 151[dbg] Looping before Zumo is running
10:15.05 152[dbg] Drive not mounted
10:15.10 153[dbg] Looping before Zumo is running
10:15.10 154[dbg] Drive not mounted
10:15.15 155[dbg] Looping before Zumo is running
10:15.15 156[dbg] Drive not mounted
10:15.20 157[dbg] Looping before Zumo is running
10:15.20 158[dbg] Drive not mounted
10:15.25 159[dbg] Looping before Zumo is running
10:15.25 160[dbg] Drive not mounted
10:15.30 161[dbg] Looping before Zumo is running
10:15.30 162[dbg] Drive not mounted
10:15.35 163[dbg] Looping before Zumo is running
10:15.35 164[dbg] Drive not mounted
10:15.40 165[dbg] Looping before Zumo is running
10:15.40 166[dbg] Drive not mounted
10:15.45 167[dbg] Looping before Zumo is running
10:15.45 168[dbg] Drive not mounted
10:15.50 169[dbg] Looping before Zumo is running
10:15.50 170[dbg] Drive not mounted
10:15.55 171[dbg] Looping before Zumo is running
10:15.5Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Fenetre.actionPerformed(Fenetre.java:128)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Voila, dsl ça fait beacoup, mais je suis sûr de ne rien oublier la
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
23 juil. 2012 à 09:34
La stacktrace (trace de pile, mot à mot) correspond au fil d'Ariane de l'exécution, on empile aux appels de méthodes et on dépile aux "return". Ce sont toutes les lignes qui commence par "at" :
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Fenetre.actionPerformed(Fenetre.java:128)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Les lignes les plus importantes sont les 2 premières :
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Fenetre.actionPerformed(Fenetre.java:128)

Autrement dit, tu as une NullPointerException à la ligne 128 de Fenetre, dans la méthode actionPerformed. C'est le code de cette méthode qu'il te faut maintenant nous montrer.
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 09:59
Je te donne le code complet du Listener :
if(source == jButton3){

JFileChooser choix = new JFileChooser();
        choix.setCurrentDirectory(new File("C:/Users/Thomas/Desktop/DVD 3A INFORMATIQUE/200 logiciels"));
int option = choix.showOpenDialog(null);
choix.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

if (option == JFileChooser.APPROVE_OPTION) {
[code=java]File se = jfc.getSelectedFile();
}
}



La ligne 128 ( 123 maintenant, j'ai fait quelque changement dans mon code ) c'est celle la :
File se = jfc.getSelectedFile();
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
23 juil. 2012 à 10:48
Ça veut dire que ton jfc est null.
Je vois qu'il y a 2 JFileChooser (jfc et choix), tu t'es peut-être trompé entre les 2 ?
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 11:00
Sincèrement, je n'y comprend plus rien, j'ai essayer de changer un peu tout sur ce bout de code mais je n'y arrive pas
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 11:06
J'ai remplacer tout les choix par des jfc, résultat :
plus d'erreur commencent par mais les fichiers .exe ne sont tjs pas reconnue

if(source == jButton3){

JFileChooser jfc = new JFileChooser();
        jfc.setCurrentDirectory(new File("C:/Users/Thomas/Desktop/DVD 3A INFORMATIQUE/200 logiciels"));
int option = jfc.showOpenDialog(null);
jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);

if (option == JFileChooser.APPROVE_OPTION) {
File se = jfc.getSelectedFile();
}
}
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 11:09
Eclipse m'informe aussi que :
if (option == JFileChooser.APPROVE_OPTION) {
File se = jfc.getSelectedFile();
}
ne sert à rien et me demande donc si je veux l'effacer, bizarre étant donner que c'est cette ligne qui me permet de choisir les fichiers non ?
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 11:13
Oulala, ça fait beaucoup de post à suivre pour ma part, dommge qu'on ne peux pas éditer les précédent :/

Oui, donc je me demandais si c'était pas dût à un problème de ressource.
Est-ce que je dois mettre ce dossier dans les ressources d'Eclipse, en sachant que je devrais faire un .jar executable pour pouvoir le graver sur DVD ??
Ca résoudra peut être le probleme, enfin, si c'est possible de mettre un dossier d'1G dans les ressources
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
23 juil. 2012 à 11:36
Sérieusement, on ne comprend pas trop ton problème.
Essaie d'être plus méthodique et de résoudre les problèmes un par un.

1) Qu'entends-tu par "les fichiers .exe ne sont tjs pas reconnue" ?
Parce que de mon côté, il n'y a pas de souci, j'arrive à sélectionner un fichier ".exe".
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 12:01
Quand je clique sur les .exe, l'installation du logiciel ne démarre pas, j'ai juste le temps d'apercevoir une petite fenêtre qui s'ouvre et se referme, tout ça en 1 sec.

Par exemple, pour Avira :

Je devrais avoir : le logo d'Avira

Mais ce n'est pas le cas, car j'ai : une page blanche à la place du logo d'Avira

Je sais pas si c'est plus clair, je n'est pas pu mettre d'image.
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 12:13
Alors, je devrais avoir ceci :


Mais j'ai ceci :
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
23 juil. 2012 à 13:51
Essaie avec le look & feel "System" à la place de Nimbus.
0
Ireon Messages postés 28 Date d'inscription mardi 17 juillet 2012 Statut Membre Dernière intervention 25 juillet 2012
23 juil. 2012 à 14:19
Non, toujours la même chose :'(
0
cs_jojolemariole Messages postés 519 Date d'inscription mercredi 21 mars 2007 Statut Membre Dernière intervention 19 décembre 2016 25
23 juil. 2012 à 15:12
Pourtant, chez moi ça fonctionne :
import java.io.File;

import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class Test {

public static void main(String[] args) throws ClassNotFoundException, InstantiationException,
IllegalAccessException, UnsupportedLookAndFeelException {

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

JFileChooser jfc = new JFileChooser();
jfc.setCurrentDirectory(new File("C:/Program Files (x86)"));
jfc.showOpenDialog(null);

}

}
0
Rejoignez-nous