468,167 Members | 1,965 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

Java netbeans

5 Nibble
How to insert image from jlabel to Excel file using Java netbeans?

I have a desktop application developed in netbeans, what I really want is the Fileinputstream for image from jlabel field to Excel file, I don't know how to insert image from jlabel field to Excel spreadsheet, but I can insert text to the Excel file but I can't insert image from jlabel to Excel file, please help
Mar 9 '21 #1
6 4379
dev7060
413 Expert 256MB
How to insert image from jlabel to Excel file using Java netbeans?
More details required.
Mar 10 '21 #2
dev7060
413 Expert 256MB
Not sure what you mean when you say "from JLabel field". JLabel is a component to display text or images in a container. Show the code and mention the API being used.
Mar 14 '21 #3
91E20
5 Nibble
I just posted the application interface from Netbeans but I really want is
The person image you seeing on the interface there I want to add it to Excel spreadsheet but I don't know the code to export that image from the application to Excel spreadsheet, but am exporting the texts, only the person image I don't know how to export to the Excel spreadsheet.
Attached Images
File Type: jpg Snappshoot.jpg (175.4 KB, 13 views)
4 Weeks Ago #4
dev7060
413 Expert 256MB
show the code and mention the api being used.
^^    ⠀⠀   ⠀⠀   ⠀⠀   ⠀⠀  
4 Weeks Ago #5
91E20
5 Nibble
Dev7060, am so sorry that you are patient with me in understanding
my problem because am new to programming but I appreciate your efforts.

I just posted the code of my problem, the API I used is Swing in java netbeans
that is what am using to develop the application.
So please see attached the code for clarification.
Attached Images
File Type: jpg error code_1616171929300.jpg (210.3 KB, 17 views)
4 Weeks Ago #6
dev7060
413 Expert 256MB
ClassCastException is thrown when there exists no relationship between the classes. The question regarding API was asked with respect to the excel and database. From the attachment, I'm assuming Apache POI and Apache Derby are being used. The question is how are you reading the image. You may not need to extract anything from the label at all. Derby has a special data type to store binary data called Binary Large Object (BLOB).
Expand|Select|Wrap|Line Numbers
  1. Blob blob = result.getBlob("photo");
  2. InputStream inputStream = blob.getBinaryStream();
where result holds the reference of the ResultSet object.
4 Weeks Ago #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by Ilias Lazaridis | last post: by
20 posts views Thread by Bill DeWitt | last post: by
reply views Thread by Ginoboy | last post: by
6 posts views Thread by Giovanni | last post: by
reply views Thread by kamranasdasdas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.