Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. public void saveToFile (String fileName)
  2.     {
  3.        
  4.        
  5.         for (int row = 0; row < getRows(); row++)
  6.         {
  7.             fileName="";
  8.             for (int column = 0; column < getColumns(); column++)
  9.             {
  10.                 Character c;
  11.                 c=getCell(row,column).getTypeChar();
  12.                 fileName=fileName.concat(c.toString());
  13.             }
  14.             saveFile.add(row,fileName);
  15.         }
  16.  
  17.         try
  18.         {
  19.             PrintWriter outputFile= new PrintWriter(fileName);
  20.             for(String s:saveFile)
  21.             {
  22.                 outputFile.println(s);
  23.             }
  24.         }
  25.         catch(IOException e)
  26.         {
  27.             System.err.println(e);
  28.         }
  29.         finally
  30.         {
  31.             outputFile.close();
  32.         }        
  33.  
  34.        
  35.         System.out.println("");
  36.        
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement