🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11505

Serializing Problems

#11505
From: Anne Nortcliffe
Date: Thu, 13 May 1999 00:00
30 lines
1806 bytes
Hello, I wonder if you could help, I'm writing an application where I'd
like the user to save any changes they have made to frame contents:
taxtfields radiobuttons etc...

So I "serialized" the frames of interest and wrote them to a file. When
I tried loading them back it doesn't like it one bit.....

Now it seems to work fine with panels upto point, this gets unstook if I
write more than one panel to a file and attempt to retrieve both panels
(it complains about the the second panel)

     FileInputStream fStream2=new FileInputStream("mydata.data");
        ObjectInputStream stream2=new ObjectInputStream(fStream2);

        MyPanel pan1=(MyPanel)stream2.readObject();
        Date d=(Date)stream2.readObject();
       MyPanel pan2=(MyPanel)stream2.readObject();

It seems to be perfectly happer loading two objects of a different type.
Any ideas? Ideally I would like to simply load the frame that these
panels are in , something along the lines of;

        MyFrame fred=(MyFrame)stream2.readObject();
        frame3=fred  (setting the contents of frame3, which already
exists to fred)

Anyway, I'm sure there's away to do it, also I realise I should probably
use buffered files to speed things up a bit.....

Thankyou in advance of any help you may or may not provide..
Technical Details
Message-ID: <373AC027.57C7F50@sheffield.ac.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,6a1bbb2882b23dcc,start
X-Google-Attributes: gid111d45,public
From: Anne Nortcliffe <cop94aln@sheffield.ac.uk>
Subject: Serializing Problems
Date: 1999/05/13
Message-ID: <373AC027.57C7F50@sheffield.ac.uk>
X-Deja-AN: 477387834
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing