File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Serialization compiler error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Serialization compiler error" Watch "Serialization compiler error" New topic
Author

Serialization compiler error

Nicholas Carrier
Ranch Hand

Joined: Apr 14, 2005
Posts: 78
Ok this is an inner class in my BeatBox class.

public class MyLoadListener implements ActionListener {
public void actionPerformed(ActionEvent a) {

JFileChooser fileOpen = new JFileChooser();
fileOpen.showOpenDialog(theFrame);
File myFile = fileOpen.getSelectedFile();

try {

FileInputStream fileReader = new FileInputStream(myFile);
ObjectInputStream os = new ObjectInputStream(fileReader);
checkboxState = (boolean[]) is.readObject();

} catch(Exception ex) {

ex.printStackTrace();

}

for (int i = 0; i < 256; i++) {
JCheckBox check = (JCheckBox) checkBoxList.get(i);
if(checkboxState[i]) {
check.setSelected(true);
} else {
check.setSelected(false);
}

} // end of for loop

sequencer.stop();
buildTrackAndStart();



} // end of method

} // end of inner class

Now when I try to compile this, I get this error message complaining about my is variable, see below. Now I know I must just be missing something stupid so, if anyone can help that'd be great.

BeatBox.java:185: cannot find symbol
symbol : variable is
location: class BeatBox.MyLoadListener
checkboxState = (boolean[]) is. readObject();
^

the ^ is supposed to be under is, but I can't seem to get it to stick there
[ June 07, 2005: Message edited by: Nicholas Carrier ]

Teaching yourself anything is always the cheapest way, but it definitely takes a lot of time and effort.<br /> <br />Thank you javaranch <a href="http://"http://faq.javaranch.com/view?HowToAskQuestionsOnJavaRanch"" target="_blank" rel="nofollow">Learn How to Ask Your Question</a> and be nice
Kristin Stromberg
Ranch Hand

Joined: May 17, 2005
Posts: 91
It doesn't look like you've declared the variable "is".
Nicholas Carrier
Ranch Hand

Joined: Apr 14, 2005
Posts: 78
This is why god invented other people. Just so they can look at something so painfully obvious that it hurts. Thank you very much, I've staring at that for roughly 2 hours.
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
and the compiler message

cannot find symbol
symbol : variable is


didn't give you a clue? Basically, that's exactly what Kristin said.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Serialization compiler error
 
Similar Threads
Head Start java Beatbox serialization/deserializatoin
Problems with serialization / deserialization.
Using JFileChooser instead of serialization hard coded files
another head first beatbox question
How to writeObject an array?