File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get image through a file explorer and save it in an object attribute

 
Kabir Goro
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
i'm quite new to Java and i'd need to do the following. I post here because it seems the correct section.

I need to get an image file through an explorer and save this file in an attribute of an object i already created.

Let's say i have the class Movie, in which i have the the attribute

and i create an object called movieObj, of course an istance of the Movie class.

I now want to create this file explorer (maybe i can use JFileChooser?) and i want to save in movieObj.poster the image file chosen with the explorer.
Keep in mind i want to save the actual file, not just the path.

Can i do this? Please avoid answering with lots of code lines, they are ok if they come with an explanation though. I want to understand how things work
Thanks a lot in advance, eagerly waiting for your answers.
 
Darryl Burke
Bartender
Posts: 5116
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the API for JFileChooser and follow the link to the tutorial on How to Use File Choosers. Then go through the section of the same tutorial titled Reading/Loading an Image.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic