afficher un fichier texte
Bonjour,
J'ai un petit probleme, je fait un logiciel qui doit afficher un fichier de type txt dans une fenetre. J'arrive a l'afficher lors de la création de l'ihm. Mais mon probleme se situe au moment ou je fait ouvrir, quand je selectionne le fichier que je veut ouvrir, il ne l'affiche pas!!!
est-ce que vous pouvez m'aider?????
voila le code de la proposition ouvrir:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| if(evt.getSource() == this.ouvrir)
{
this.programReader=null;
this.computer=null;
int returnVal = this.fc.showOpenDialog( this );
if (returnVal == JFileChooser.APPROVE_OPTION)
{
String fichierCourant = this.fc.getSelectedFile().getAbsolutePath();
System.out.println( fichierCourant );
this.programReader = new ProgramReader(fichierCourant);
this.program = this.programReader.read();
this.dataSegment = this.program.getDataSegment();
this.dataSegment.createMemory();
this.dataSegment.afficher();
this.computer = new Computer( this.program );
//fenetreFichier.update();
}
} |