🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: regaining functionality from save file

#783
From: Arthur Ore
Date: Tue, 28 Dec 2004 12:19
31 lines
1913 bytes
Yes it's because the fields are static. If you look at the javadocs for the 
Serialization interface it hints that only an object's non-static and 
non-transient fields are serialised.

Arth

 One of the classes I created called Table has a member of
> primitive type int. Like so:
>
> public class Table extends JPanel implements Serializable
> {
>  ...
>  private static int RowCount = 0;
>  ...
> }
>
> Table winds up being one of the objects being saved to file.
> When I open the file for some reason this Table object doesn't retain the
> state of what RowCount held originally when it was saved.
>
> Is it because it was declared static or something silly like that?
>
> When the file loads it displays all the TableRow objects in the Table as
> expected, but for some reason RowCount doesn't retain the number it had of
> these TableRow objects.
>
> Any ideas?
>
> Alan
>
> 
Technical Details
Message-ID: <41d14f68@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41d0409e$1@newsgroups.borland.com> <41d07923@newsgroups.borland.com> <41d0c540$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,24838fa202265eb4
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Arthur Ore" <nospamthx_arthur@nospamthx_arthurore.freeserve.co.uk>
Newsgroups: borland.public.jbuilder.java.swing
References: <41d0409e$1@newsgroups.borland.com> <41d07923@newsgroups.borland.com> <41d0c540$1@newsgroups.borland.com>
Subject: Re: regaining functionality from save file
Date: Tue, 28 Dec 2004 12:19:58 -0000
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 82.69.65.131
Message-ID: <41d14f68@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1104236392 82.69.65.131 (28 Dec 2004 04:19:52 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail