Results 1 to 4 of 4
- 12-01-2012, 06:54 PM #1
Senior Member
- Join Date
- Mar 2011
- Posts
- 171
- Rep Power
- 0
Importing an image from a users computer
Hi,
So I'm creating an address book, and for the most part I have it developed. But I wanted to have a box that the user can click on, browse his/her computer for a picture and then choose to add that picture to the picture frame or label. This need to be a persistent object, meaning the user can stop running the program and then open it back up and see the picture still there
any leads?
- 12-02-2012, 09:26 AM #2
Re: Importing an image from a users computer
So first of all breajk that up into its constituent operations so you can tell us what you're haveing trouble with.
-- reacting to user action? --> JButton
-- browsing the file system? --> JFileChooser
-- loading the image from file? -->ImageIO/ImageIcon
-- displaying the image? -->JComponent/JPanel/JLabel
-- persisting the data? --> several options available
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 12-02-2012, 06:19 PM #3
Senior Member
- Join Date
- Mar 2011
- Posts
- 171
- Rep Power
- 0
Re: Importing an image from a users computer
Its really kind of all of that. I don't know where to start.
Initially I was thinking about just using a JLabel and creating like an import path or something like that
As per browsing I guess I would use file chooser.
Here is what I was thinking about layout wise...
You have the box with your standard blank contact picture initially.
Click on the box, it will bring up the file chooser
The user chooses the path for the import... and this is where I don't really know what to do.
-- I know how I would set the path up to get the picture to show, but what I want to do is import that picture into my my working directory and use that every time that contact is chosen.
So in other words, save the picture with my Contact object that is being saved.
I am using space4J for my object persistence
- 12-03-2012, 07:23 AM #4
Re: Importing an image from a users computer
Here's a good place to start: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Importing Data From Custom Objects for POJO & Convert Sheet to Image
By sherazam in forum Java SoftwareReplies: 0Last Post: 04-13-2012, 12:37 PM -
send image from computer to mobile
By amer in forum CLDC and MIDPReplies: 0Last Post: 06-04-2010, 06:35 AM -
restrict users from entering the image/text files path directly in the browser.
By vishnujava in forum Java ServletReplies: 6Last Post: 08-06-2008, 01:41 PM -
Accounts of users
By Eric in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 06-27-2007, 04:20 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks