You don't serialize the java program. You only need to save the current values in variables like ints and Strings.
For your test program, remove ALL of the GUI. No frames, panels, buttons etc.
...
Type: Posts; User: Norm
You don't serialize the java program. You only need to save the current values in variables like ints and Strings.
For your test program, remove ALL of the GUI. No frames, panels, buttons etc.
...
A 300 line file is not a small program.
You don't need any GUI to test Serialization with. Just some classes to write and read back.
The frame doesn't show any components and doesn't handle window...
To have a class implement an interface:
class ClassName implements Serializable {
Add this just before the writeObject(theObject):
System.out.println("obj class=" + theObject.getClass()); ...
Go read post#12
Did you understand what the API doc said for that Exception?
do you use writeObject()
Yes
Please explain "what I want".
No you can use any file extension that you want. Chose one that won't confuse the OS. Like .dat or .ser
Best way to answer all your questions is to write a small...
How did you write them out? Take the class name and replace Output with Input
If you serialize an object to a file using an output class, you use the corresponding input class to read the object back into a java program and recreate the object as it existed when it was written...
Best way to answer all these "what if" questions is to write a small test program and see what happens.
Yes, you can only serialize objects that are.
Try instanceof to test a class.
I'd suggest that you write a small test program with a few simple classes and work on writing them to a disk file using a ObjectOutputStream and then read them back with a ObjectInputStream and...
Hard question to answer.
The quick answer is somewhere in your code.
The "what data" is really hard. What do you want to be able to retrieve later?
JFileChooser is a way to have the user...
Your program is too large to work with.
Can you make a small program that compiles and executes to demonstrate the problem?