1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public class Modele {//extends Observable {
private HashMap logiciels ; //nom logiciel + chemin acces
private FileReader flot ;
private BufferedReader flotFiltre ;
public Modele() {
super() ;
logiciels = new HashMap();
try {
flot = new FileReader("liste_logiciels.txt");
flotFiltre = new BufferedReader(flot);
String ligne = flotFiltre.readLine() ;
String nom ;
String cheminLogiciel ;
while (ligne != null) {
nom = ligne;
cheminLogiciel = flotFiltre.readLine();
logiciels.put(nom, cheminLogiciel);
System.out.println(nom+""+cheminLogiciel);
}//while
flotFiltre.close();
}//try
catch(IOException e){
JOptionPane.showMessageDialog(null,e.getMessage(),
"Alerte",JOptionPane.ERROR_MESSAGE) ;
}//catch
} |
Partager