0

I've got an excel document and i need to take an image of the first sheet and use it to put in the icon of JLabel. How can I do it?

marcss
  • 253
  • 2
  • 14

1 Answers1

2

I don't think Apache POI provides anything here as it is not concerned about displaying the data, only about retrieving and updating the data in the Excel Workbook.

So basically only Excel and other office applications like LibreOffice know how to actually display the data.

A few alternative options that come to my mind:

  • Use some other software to display the contents as a web-page and use Selenium to take a screenshot, see e.g. Take a screenshot with Selenium WebDriver
  • Programmatically open the file in Excel on a Windows box, then use some screenshot utility with automation support
Community
  • 1
  • 1
centic
  • 15,565
  • 9
  • 68
  • 125