• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Serialization compiler error

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't look like you've declared the variable "is".
 
Nicholas Carrier
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and the compiler message

cannot find symbol
symbol : variable is



didn't give you a clue? Basically, that's exactly what Kristin said.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic