I am creating a simple photo catalogue using JAVA and Netbeans. I have the basic Swing layout all OK and I can store and retrieve text/number etc from/to the database, delta records etc etc. This is all Fine.
I am really not sure how to go about storing the images and viewing them in the jFrame.
I want to store the images as a file path I think (as opposed to BLOB) as I have read this is better?
I am using getText and setText to display the database entries on the form at present and this is all fine. Like below:
String location = rs.getString("Location");
textLocation.setText(location);
I am using the JavaDB derby database connection.
I have searched for a tutorial but have not had much luck. There are tutees fro images etc but not really how to store/retrieve them from a database.
If anyone can point me in the right direction or to a good tutorial covering this that would be grand.
* UPDATE *
Thanks for the help. I thought I would just share what ended up working.
Set path to location of images folder:
private static final String PATH = "/images/";
Assign string
String image = rs.getString("ImageURL");
Add image to label
image_label.setIcon(new javax.swing.ImageIcon(getClass().getResource(PATH + image)));
Thanks again.