
Signature
Knute Johnson
email s/nospam/knute/
ok - to clarify...
What I would like to save is a set of data. so for instance, a text
field, and an image. I want to combine these items into a single save
file. The text (entirely seperate from the image) should be saved to
file, along with the image.
When the user opens the file that was saved (a single file containing
the text, and the image) it will open the file and insert the text
into a text box, and the image (if specified) into the image area...
On Sep 16, 7:37 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> > Hi!
>
[quoted text clipped - 46 lines]
>
> - Show quoted text -
Knute Johnson - 17 Sep 2007 02:10 GMT
> ok - to clarify...
>
[quoted text clipped - 6 lines]
> the text, and the image) it will open the file and insert the text
> into a text box, and the image (if specified) into the image area...
OK that makes a lot more sense. Many objects can be serialized and
saved to disk. Although the Image class can't be serialized, the
BufferedImage can have its data saved in an array and an array can be
serialized. A JTextField keeps its data in a String which can also be
serialized. So you could create a class that held your String and your
array and write that to disk. If they don't have to be in the same
exact file your could easily write the image to one file and the string
data to the other. The only drawback is two files but the advantages
are obvious.

Signature
Knute Johnson
email s/nospam/knute/
tiewknvc9 - 17 Sep 2007 05:05 GMT
On Sep 16, 9:10 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> > ok - to clarify...
>
[quoted text clipped - 21 lines]
> Knute Johnson
> email s/nospam/knute/
thanks!
Andrew Thompson - 17 Sep 2007 05:05 GMT
>ok - to clarify...
Top-posting is not a good way to clarify things. I
for one, find it most confusing.
...
>When the user opens the file that was saved (a single file containing
>the text, and the image) it will open the file ...
There are a numer of aspects to this problem, and the file
format itself has been covered by a number of people, so
I will limit my reply to invoking the app. to open the file.
Web start provides mechanisms to associate a filetype
with an application. I show the technique in this example
that links the '.zzz' file type with the filetest app.
<http://www.physci.org/jws/#fs>

Signature
Andrew Thompson
http://www.athompson.info/andrew/