在Java Swing应用程序中导入Excel(.xls) [英] Importing Excel (.xls) in Java Swing application

查看:219
本文介绍了在Java Swing应用程序中导入Excel(.xls)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Microsoft Excel(XLS)文件导入Java Swing应用程序?

How to import Microsoft Excel (XLS) file into the Java Swing application?

推荐答案

有几个开源可用于阅读excel文件的库,例如 Apache POI

There are a couple of open source libraries which you can use to read an excel file such as Apache POI.

将excel文件读入某些数据结构后,可以将其写入用于JTable的DataModel。或者,您可以编写一个自定义的DataModel,它将从excel文件中动态读取,但是,一旦您了解您选择的excel文件阅读库,我将分别采取两个步骤,并增加复杂性。

Once you've read your excel file into some data structure, this can be written into a DataModel for a JTable. Alternatively, you could write a custom DataModel which will read dynamically from the excel file, but I'd take the two steps seperately and build up the complexity once you understand the excel file reading library you choose.

这篇关于在Java Swing应用程序中导入Excel(.xls)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆