catch (Exception e){ e.printStackTrace() }
public String[] tadjectif = new String[Maxnbmot]; String adjectifs = "G:\\Users\\mohamet fall\\Documents\\NetBeansProjects\\Phrase\\adjectifs.txt"; String chaine=""; String[] result = motstfd.getText().split("\\s"); try{ InputStream ips=new FileInputStream(tadjectif); InputStreamReader ipsr=new InputStreamReader(ips); BufferedReader br=new BufferedReader(ipsr); String ligne; while ((ligne=br.readLine())!=null){ for (int x=0; x<result.length; x++){ if(ligne.intern().equals(result[x])){ tadjectif[x]= result[x]; } } chaine+=ligneadv+"\n"; } br.close(); System.out.println("liste des adjectives"); for (int x=0; x<result.length; x++){ System.out.println(tadjectif[x]); } } catch (Exception e){ System.out.println(e.toString()); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionpublic String[] tadjectif = new String[Maxnbmot]; String adjectifs = "G:\\Users\\mohamet fall\\Documents\\NetBeansProjects\\Phrase\\adjectifs.txt"; String chaine=""; String[] result = motstfd.getText().split("\\s"); try{ InputStream ips=new FileInputStream(tadjectif); InputStreamReader ipsr=new InputStreamReader(ips); BufferedReader br=new BufferedReader(ipsr); String ligne; while ((ligne=br.readLine())!=null){ for (int x=0; x<result.length; x++){ if(ligne.intern().equals(result[x])){ tadjectif[x]= result[x]; } } chaine+=ligneadv+"\n"; } br.close(); System.out.println("liste des adjectives"); for (int x=0; x<result.length; x++){ System.out.println(tadjectif[x]); } } catch (Exception ex){ ex.PrintStackeTrace(); }