-
-
Save khous/ea503a9b61b6989f7d72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void loadTable(Spreadsheet sheet) { | |
String fileName = "text.txt"; | |
try { | |
Scanner scanner = new Scanner(new File(fileName)); | |
int row = 0; | |
int column = 0; | |
while (scanner.hasNext()) { | |
String str = scanner.next(); | |
System.out.print(str); | |
if(column == 26) { | |
column = 0; | |
row ++; | |
System.out.println(); | |
} | |
Cell cell = sheet.getCell(row, column); | |
cell.setFormula(str, sheet); | |
table.setValueAt(cell.getFormula(), row, column); | |
column++; | |
} | |
repaint(); | |
} | |
catch (FileNotFoundException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment