Basically, I have a camera photo. I put a label on it and save it.
After I saved, the attribute Date Picture Taken of the photo is empty when I check the photo with window explorer.
The date information is held in the meta data of the file. I'm not sure how this can be set but I know there are free Java libraries for reading the data such as http://code.google.com/p/metadata-extractor/. Sorry I can't be of more help other than suggesting you google for details on how to set the meta data.
Not sure if your creating a platform independent application, but if not, there is a great command line tool (free) called exiftool that you can exec(). I've found this tool to be more robust and complete than metadata-extractor. But of course it's not a java library.
With the java code posted as I need to put a label over the picture, the tag DateTimeOriginal which is Date Taken Picture of the photo jpg file is no longer there.
I try to use exiftool to add that tag (as it's a new tag as the existing one is gone), I could not see what the syntas is.
-To mod the existing tag
exiftool "-DateTimeOriginal+=5:10:2 10:48:0" mypicture.jpg
-To add the new tag DateTimeOriginal, what is the syntax? Could not figure out.