difference jFrame / applet
bonjour,
j'ai changé un jframe en applet.
au passage l'initialisation du jTree ne marche plus.
j'initialise comme suit:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| try {
dbf = DocumentBuilderFactory.newInstance();
db = dbf.newDocumentBuilder();
java.net.URL url=getClass().getResource("/material/mat.xml");
doc = db.parse(url.openStream());
} catch (java.io.IOException e1) {
JOptionPane.showMessageDialog(null,"Failed to read XML file:\n"+e1.getMessage());
return;
} catch (SAXException e2) {
JOptionPane.showMessageDialog(null,"Failed to parse XML file:\n"+e2.getMessage());
return;
} catch (ParserConfigurationException e3) {
JOptionPane.showMessageDialog(null,"Parser configuration exception:\n"+e3.getMessage());
return;
} |
dans le programme jFrame, le tree affiche le contenu du fichier mat.xml, mais dans l'applet le tree n'affiche rien.
comment faire?
merci