probleme ecriture dans un fichier
bonjour, voici mon problème :
j ai un bouton dont l ActionPerformed est la suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
public class SaisirFDTPD extends AbstractAction {
public SaisirFDTPD (String text){
super(text);
}
public void actionPerformed(ActionEvent e) {
File FDTPartition = new File("FDTPartition.xml");
System.out.println(saisieFDT.getText());
//String resultat = saisieFDT.getText();
FileWriter sortie = new FileWriter(FDTPartition);
sortie.write(saisieFDT.getText());
sortie.flush();
sortie.close();
}
} |
je ne comprend pas pourquoi ce bout de code est erroné...
si j ecris comme ca
Code:
public void actionPerformed(ActionEvent e) throws IOException
l IDE m indique que l IOException n est pas prise en charge par l actionPerformed.
si quelqu un pouvait m aider merci.
a la base je voulais ecrire dans un fichier le contenu d une zone de saisie.