Advertisement
miszczo

javaaaaaaa

Apr 15th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1.  
  2. private String linia;
  3. public ArrayList<Double> dane = new ArrayList<>();
  4. int a =10;
  5.  
  6. JFileChooser jfc = new JFileChooser(".");
  7.  
  8.  
  9.  
  10.  
  11. if(jfc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION){
  12. File f = jfc.getSelectedFile();
  13. try {
  14. FileReader fr = new FileReader(f);
  15. BufferedReader br = new BufferedReader(fr);
  16. int i = 0;
  17. while((linia = br.readLine())!=null){
  18. dane.add(Double.parseDouble(linia));
  19. System.err.println(dane.get(i));
  20. i++;
  21. jTextArea1.append(linia+"\n");
  22.  
  23. String output = "";
  24. output+="blbabka";
  25.  
  26. }
  27.  
  28.  
  29.  
  30.  
  31.  
  32. } catch (FileNotFoundException ex) {
  33. Logger.getLogger(widok.class.getName()).log(Level.SEVERE, null, ex);
  34. } catch (IOException ex) {
  35. Logger.getLogger(widok.class.getName()).log(Level.SEVERE, null, ex);
  36. }
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement