Wait, can I get it to write an entire program, like have a small program, then have, in another file in the Eclipse project, write the first class into the ObjectOutputStream?
Is that what you...
Type: Posts; User: javapenguin
Wait, can I get it to write an entire program, like have a small program, then have, in another file in the Eclipse project, write the first class into the ObjectOutputStream?
Is that what you...
import java.awt.color.ColorSpace;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.AdjustmentEvent;
import java.awt.event.ItemEvent;
import...
How do you get an object to implements the Serializable interface?
I have the entire class implementing Serializable.
Anyway, Serializable has no methods.
Also, so far it appears all of my...
java.io.NotSerializableException: java.io.ObjectOutputStream
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at...
So do you use writeObject() to serialize it?
If not, how do you serialize it?
I know I use ObjectInputStream and FileInputStream
but what method?
I tried using an ObjectInputStream.readObject() but it doesn't appear to do what I want.
Perhaps I need to get it to...
Ok, but how do you get it to read the objects back in?
I gave a sample program.
>:D<\:D/^:)^^:)^[-O<[-O<=D>=D>:-t:-t:-t~X(~X(:-bd#-o
I have no clue what sort of file a regular GUI would be compatible with. I tried .rtf and it gave me just a Word doc with code, though it wasn't the same code, exactly anyway, that I had used to...
I thought I could actually, but I could only if I serialized all of the fields and all the fields it inherited.
So how do you write Objects that aren't serializable?
...
And if it isn't an instance of Serializable, does that mean I can't use it? If I can use it, what did you mean by "fields"?
...
What do you mean that I have to include all of the fields that get inherited? Also, can it only be saved once and not saved over? What's not forward compatible? By fields, do you mean if I have a...
What do you mean previously saved files may not be forward compatible? Are you saying that once saved, the user can't keep saving over it and updating it?
import java.awt.color.ColorSpace;...
Is there a way I can add the Components to the saved version? How do you Serialize something?
Suppose I have a JPanel, which has a title as class extends JFrame, a JTextArea, and a couple of...
I want the everything to be there. For instance, make a JTable, add text to it, hit save, and then load it and have the text still in it. Plus I wouldn't mind having the background and the JPanel...
I don't know how to get the FileWriter to get the text typed in the file name area in the JFileChooser, and it never saves the file, or, if it does, it doesn't save anything and the file keeps...