Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3280 connectés 

 


Dernière réponse
Sujet : [JAVA] Interface Graphique et fichier HTML local
cezium c bon ca marche suffisait de mettre ca
 
JEditorPane jep=new JEditorPane(new URL("file:/c:/resultat.htm" ));  
 
ya'avais un / en trop
 
 :bounce:  :bounce:  :)

Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
cezium c bon ca marche suffisait de mettre ca
 
JEditorPane jep=new JEditorPane(new URL("file:/c:/resultat.htm" ));  
 
ya'avais un / en trop
 
 :bounce:  :bounce:  :)
cezium

DarkLord a écrit a écrit :

Il essaie de prendre la page par FTP. J'ai jamais eu ce problème. N'oublie pas que JEditorPane est seulement compatible  HTML 3.2
 
http://developer.java.sun.com/deve [...] rchive/29/  




 
ok, en fait le fichier html que j'essaye d'afficher , c 'est un fichier que je crée, y'a un moyen de le creer pour qu'il soit compatibe avec html v3.2 ?

darklord Il essaie de prendre la page par FTP. J'ai jamais eu ce problème. N'oublie pas que JEditorPane est seulement compatible  HTML 3.2
 
http://developer.java.sun.com/deve [...] rchive/29/
cezium toujours le meme problème
 
        URL testurl=new URL("file://C://listefilm.htm" );
        JEditorPane jep=new JEditorPane(testurl);
 
 
java.net.UnknownHostException: C
 at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:81)
 at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:96)
 at javax.swing.JEditorPane.getStream(JEditorPane.java:569)
 at javax.swing.JEditorPane.setPage(JEditorPane.java:320)
 at javax.swing.JEditorPane.<init>(JEditorPane.java:180)
 at aspiweb.GUI.drawHtml(GUI.java:109)
 at aspiweb.GUI.main(GUI.java:188)
 at aspiweb.__SHELL12.run(__SHELL12.java:16)
 at bluej.runtime.ExecServer.suspendExecution(ExecServer.java:139)
 at bluej.runtime.ExecServer.main(ExecServer.java:69)
darklord ton URL est fausse déjà !!!
 
Commence par construre ton URL avant d'appeler ton constructeur avec !
cezium voila la trace de l'erreur avec cette commande:
JEditorPane jep=new JEditorPane(new URL("c:/resultat.htm" ));
 
 
java.net.UnknownHostException: c
 at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:81)
 at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:96)
 at javax.swing.JEditorPane.getStream(JEditorPane.java:569)
 at javax.swing.JEditorPane.setPage(JEditorPane.java:320)
 at javax.swing.JEditorPane.<init>(JEditorPane.java:180)
 at aspiweb.GUI.drawHtml(GUI.java:108)
 at aspiweb.GUI.main(GUI.java:187)
 at aspiweb.__SHELL9.run(__SHELL9.java:16)
 at bluej.runtime.ExecServer.suspendExecution(ExecServer.java:139)
 at bluej.runtime.ExecServer.main(ExecServer.java:69)
darklord

cezium a écrit a écrit :

DarkLord > non, c pas un applet
 
Benou> c'est une IOException
 
au fait question con, quand je fais printStackTrace(), il écrit où le fichier avec les erreurs ?  




 
la console. Envoie la trace de l'erreur dans un post

cezium DarkLord > non, c pas un applet
 
Benou> c'est une IOException
 
au fait question con, quand je fais printStackTrace(), il écrit où le fichier avec les erreurs ?
darklord benou >>> java.net.URL gère le protocole file
benou t'es sur que java.net.url gère le protocole "file://" ???
 
c'est quoi le message de l'exception que tu te manges ?
darklord c une applet?
 
Sinon tu n'as qu'à faire
 
try {
  JEditorPane jep = ....
}
catch (Exception e) {
  e.printStackTrace();
}
 
et tu verras déjà bcp plus clair  :heink:
cezium salut a tous
 
g kelke petit problème avec une interface graphique dont voici un bout de code:
JEditorPane jep=new JEditorPane(new URL("file://c:/resultat.htm" ));
 
quand j'écris cela, le fichiers htm ne s'affiche pas dans mon interface mais quand je met par exemple:
JEditorPane jep=new JEditorPane(new URL("http://www.exemple.com/test.htm" ));
ca fonctione, je ne comprends pas pourkoi celui avec le fichier local ne veut pas s'afficher dans l'interface.
 
 
g aussi un petit problème avec:
    JTabbedPane jtp=new JTabbedPane();
    jplog=new JPanel();
    jtp.add(jplog);
 
comment donner un nom a l'onglet qui va etre dans l'interface graphique au JPanel  jplog
 
merci d'avance

Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)