如何从JTable中的.ods文件查看工作表?我使用odftoolkit简单的API,这就是我如何打开文件.ods电子表格到JTable
String filepath;
if (openfile.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
filepath = openfile.getSelectedFile().getAbsolutePath();
try {
doc = SpreadsheetDocument.loadDocument(filepath);
} catch (Exception e) {
JOptionPane.showMessageDialog(null,
Locale.getString("fileError.message"),
Locale.getString("fileError.title"),
JOptionPane.ERROR_MESSAGE);
return;
}
在这个时候,我得到的每一行与doc.getTableList().get(0).getRowList()
。我怎么能把每一行变成数组?
什么类型的'doc.getTableList()。get(0).getRowList()'return?我很确定它提供了一些方法,可以让你制作一个数组。 – MightyPork
他们的API是否有Javadoc?你有没有试过读过它? – Bill
'getRowList()'返回一个'Row'列表,我在'Row'类中找不到有用的方法。也许我很愚蠢,也许不是; D 当然有。不,我刚刚搜索了一下。 – LivingSilver94