Post by b***@gmail.comPost by z***@gmail.comHere are three way to do this.
1. Use "JTableReadTableModelTask " to do this. ( recommended )
2. Use "ReadTableModelTask" to do this
3. Use ModelIO to do this.
For details: http://www.zfqjava.com/article/How-to-import-excel-into-JTabel.html
Hi,
Where can i download the jar contains "JTableReadTableModelTask "? Thank you
JTable jTable = new JTable();
String excelFileName = "excelFileName.xls";
File file = new File(excelFileName ); //‘file’ is the file you want to load.
JProgressBar progressBar = new JProgressBar(); //‘progressBar’ will show how much data it have loaded.
JTableReadTableModelTask task = new JTableReadTableModelTask(file, null, progressBar, jTable);
task.execute();
JTable jTable = new JTable();
String excelFileName = "excelFileName.xls";
File file = new File(excelFileName ); //‘file’ is the file you want to load.
JProgressBar progressBar = new JProgressBar(); //‘progressBar’ will show how much data it have loaded.
JTableReadTableModelTask task = new JTableReadTableModelTask(file, null, progressBar, jTable);
task.execute();
After adding the jar in http://www.zfqjava.com/download/componentpack-3.6-eval.zip to your classpath.