I have my load working (filter is another class):
String name;JFileChooser chooser = new JFileChooser(); //<-- Opens a pop up choosersFile file = chooser.getSelectedFile(); //<-- sets filter chooser.setFileFilter(new OurFilter()); int status = chooser.showOpenDialog(null);name = file.getName();// reads file (objectInputStream and readObject stuff)//end
String name;JFileChooser chooser = new JFileChooser(); //<-- Opens a pop up choosersFile file = chooser.getSelectedFile(); //<-- sets filter chooser.setFileFilter(new OurFilter()); int status = chooser.showSaveDialog(null);name = file.getName();// proceeds to write to the file using writeObject and closes stream//end
3/8/2006 12:39:17 PM
btttcome on java d0rks, plz speaketh
3/8/2006 4:57:41 PM
this may or may not be the problem but just out of curiosity, are both of those snippets of code in the same method?
3/8/2006 5:11:38 PM
I have a saveAll() method that writes three or four different listsand a loadAll() method that should load the lists from the "name" of the selected filethese methods run depending on which Jmenu item is picked
3/8/2006 5:27:14 PM
I haven't actually messed with JFileChooser's myself but I'll see if I can play around with one here sometime soon. What I was thinking though is that maybe theres some kind of problem relating to trying to load/save the same file, I was having a similar problem the other day with a BufferedReader/FileWriter.
3/9/2006 12:26:13 AM
I pretty sure the problem is my syntax some where. Because when I specify the file name ("alllist.dat") instead of using JFileChooser, it works
3/9/2006 8:01:27 AM