Confusion saving files.....

Hi guys I dont know what is going on with my code.I am trying to save an array into a file but when I load it i get nulls can anyone have a look at the following code? There are two methods the one is openFIle and the save but i dont know where i am doing wrong.Thanx
cancel=true;
        JFileChooser fileChooser= new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        int result =fileChooser.showOpenDialog(this);
        if(result==JFileChooser.CANCEL_OPTION )
            return;
        filename =fileChooser.getSelectedFile();
        if(filename==null || filename.getName().equals(""))
            JOptionPane.showMessageDialog(this,"Invalid File Name","Invalid File Name",JOptionPane.ERROR_MESSAGE);
        else
            try
                output=new ObjectOutputStream(new FileOutputStream(filename));
                cancel=false;
            }catch(IOException ioException)
                JOptionPane.showMessageDialog(this,"Error Opening File","Error",JOptionPane.ERROR_MESSAGE);
public void save()
        if (!cancel) {
            try {
                for (int i = 0; i < person.length; i++) {
                    System.out.print(person.name);
if (person[i] != null) {
Person p=person[i];
output.writeObject(p);
output.flush();
}else break;
} catch (IOException ioException) {
closeFileOutput();

How/where you initialise the person array?
What is the o/p of line
System.out.print(person.name); ?
Will you pls. post some more code so that we can know which are global values.

Similar Messages

  • Saving files to a specific folder

    I used to be a PC, now I am a Mac, learning fast, but I have a problem in saving files from the web. I am using OS 10.4.7
    I am using Firefox and Thunderbird.
    When I try to save email or a picture from a web site I am presented with a Menu; Save as, Where and Format. The 'Where' is the problem.
    When I click 'WHERE', I am presented with a list;
    Network
    Mac HD 80
    Mac HD 60
    Desktop
    MCMP (HOME, where all my different folders are)
    Applications
    Movies
    Music
    Picures
    When I click on MCMP, my home with all my sub folders, there is no way to save the file any place but just in MCMP. I have no options which folder in MCMP or sub folder of a main topic folder. Saving to MCMP just puts the file in with all my different folders.
    How do I direct exactly which folder the item is to be saved into.
    Thank You
    WM300

    wm
    Spring loaded folders: Drag a file to a flder, hold it over it and the folder will open. You can use this to drop files into sub folders and so on. The timing on how long you have to hold is controlled in the Finder preferences -> General Pane.
    Another possibilty for your original question is to use Default Folder X, a shareware, that makes navigating open and close dialogues very easy.
    http://www.stclairsw.com/
    Regards
    TD

  • Authenication needed when moving or saving files to a folder

    I've been online searching but can't find a resolution to disabling having to authenticate when moving or saving files to any folder.
    I read something about using Terminal and tried the suggestion which was typing in
    sudo chawn -R yourshortname . Then putting in my password when prompted. It either will not type my password or not accept it.
    Can anyone help? Thanks

    You can't disable or correct it with that command. See http://discussions.apple.com/thread.jspa?threadID=1216618 for more information.

  • Saving file to network location

    Hello all of you,
    I encounter an issue with InDesign CS5 when it comes to opening and saving files to a network location. I added my company's ftp server to Windows 7 and it appears correctly in the My computer overview (there's an additional line besides the hard discs, DVD player, et cetera). The connection to the server functions fine, no issues here. No problem exists when opening files from this server from within InDesign; I can do whatever I want. Only when I try to save a file the network location isn't displayed anymore within the My computer overview in the InDesign "Save as" dialog box. The network location however appears in the pull-down menu at the top of the dialog box (and nested as part of My computer ...), but when I pick it there, it won't show the context of the server. Additionally logging onto the server (it's IP-based and anonymous logon) doesn't change a thing. Trying to save in the empty server space InDesign returns a "Can't save here" error message.
    Does anyone know how to solve this issue? Building the document locally and then copying back to the server isn't a solution, because all external content that is linked in the document resides on the server.
    Best regards,
    Luc Peulen

    Does anyone know how to solve this issue? Building the document locally and then copying back to the server isn't a solution, because all external content that is linked in the document resides on the server.
    Scott is basically right. Lots of ID users work over network connections without issue, but if something is going wrong, it's the first place to look. I wouldn't have thought it possible to work in InDesign over a FTP connection!
    If you can get Windows to access that server as if it were just another drive (using "Map network drive" in Explorer) then it should work normally. However, a generic Adobe phone tech wouldn't help you figure out why it wouldn't work - there are simply too many variables in a network environment for a generic first-level tech to figure out.
    In the short term, the only solution I can suggest is:
    Retrieve all of that external content that is linked in the document, and the InDesign document, at the same time, & store it on your local hard drive.
    Do your work.
    Save & package.
    Upload the entire package back to the server.
    Long-term, you'd need to talk to your own IT staff to troubleshoot the connection between your workstation and the FTP server. If you can get information about your network from them to post here, I bet that someone will make suggestions to pass on to your IT staff that will actually work.

  • How to get a gif file to loop in PE11 with MAC 10.6.8? 480x320x72 pix/in. saved layers for web, check animate,preview plays fine but saved file doesnt

    can't figure out why the gif file won't loop. Set up 5 photo frames 480x320pixels x 72pix/in in PE11, creating a layer for each. Each layer visible. Saved for web. Checked animate. The preview plays fine. But when I save the file and then click on the saved file to play, it re-opens the layers instead of playing the loop. The only SAVE option that shows up is "IMAGES ONLY"
    Using photoshop elements 11 on MAC 10.6.8. Either I'm setting this up wrong or is there a hidden setting I need to change?

    Thanks for the thought, Barbara B. Not sure if this counts, but emailed the file to myself [different email account, same computer] but it would not play as an email attachment. Any suggestions for a web upload where I can test your suggestion? Seems like there should be a different save option other than IMAGES ONLY but that is the only option I'm given.

  • Office 2013 applications cannot be made to show the "Documents" folder when opening and saving files

    (Windows Server 2012R2 and Windows 8.1 PRO)
    We are redirecting the user's "Documents" folder to the network (using Folder Redirection). The OS hides this fact however, and most applications simply see the "Documents" folder when opening or saving files, including Office 2003.
    Office 2013 however displays the actual path, which in this case is:
    \\sever1\redirect$\username\documents
    Even if you forcibly set the "Default local file location:"  in the Options Save area to the 'Documents' folder in, say, Word, Word immediately converts the local path to the network path.
    Is there anyway to get Office 2013 to follow the virtual path? All of other apps follow it and expose the users only to "Documents".
    Thank you so much.
    Dana

    There's nothing in my FAQ concerning screen savers, so I'm unsure why you decided to take that approach. From your description, it looks like you only tried a few of the suggestions before throwing in the towel. That's fine, it's your call.
    I don't have the problems you described with 10.4.7. Usually when folks have problems after an update, these are caused by either installing an update on an already-corrutped system or they've installed third-party applications or hardware that have been rendered incompatible by the update.
    Before installing software updates, you may wish to consider the advice in my "Installing Software Updates" FAQ. Taking the steps therein before installing an update often helps avert problems and gives you a fallback position in case trouble arises.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • HT5824 I've been using numbers for iPad and I accidentally deleted a column. And the auto-save feature saved that and now I can't undo it. Does iCloud storage have backups of saved files from like 10 minutes ago? I have number

    I've been using numbers for iPad and I accidentally deleted a column. And the auto-save feature saved that and now I can't undo it. Does iCloud storage have backups of saved files from like 10 minutes ago? I have numbers synced to iCloud.
    I tried to undo it but the app crashed.
    I am hoping there's like a previously saved version of my file in iCloud somewhere. 

    No, iOS does not do short term incremental back ups to iCloud such as you get with Time Capsule.It backs up when you do soo manually, or if set properly, when the device is plugged in and connected to WiFi. It will not have saved your changes as of 10 minutes prior.

  • How can I revert to a previous saved file?

    Hi,
    I have been working on Word for Mac 2011 and have been saving continuously onto the same document as my work progresses. I always reference manually and somebody suggested I use footnotes to reference. This was too problematic as I needed to reference separately
    at the end of three sections and footnotes was only allowing me one lot of references. So I copied and pasted my other two sections underneath the footnote referencing  and Word must have assumed it was part of the footnotes because when I completed my
    work and went back to re-reference each section manually and delete the old footnote references, I lost all my work done underneath the footnotes! Now, I hear you can "revert to previous saved file" or some other such thing  to go back to a
    previous save of the same document. Any help is greatly appreciated on how to do this!!
    Thanks,
    Ayema

    If you haven't saved the document, pressing Command+Z will undo the paste.
    If you have already saved the file then hopefully you have the option set in preferences to Always Create a Backup and in the folder where the original file is locate you will find a file name "Backup of..." the file name you are working on. This
    will be a how the file looked prior to the last save.
    If you don't have the Always Create a Backup option set, besides "Shame on You" then go to your Time Machine backup which should be no more than 1-hour old and you can get previous hours... assuming you have that function enable. If you don't then
    again... Shame on You!
    If you have neither of these built-in options set then I pray you are using my
    GotUrBack application running, which will protect you with up to 9 levels of backup of your saved version of the file.
    http://www.greatcirclelearning.com/zapps-got-ur-back
    And if you don't have any of the above set or running then I'm sorry to have to say... you are out of luck and have a great deal of file recreation to do.
    Kind Regards, Rich ... http://greatcirclelearning.com

  • Error in saving file. this is an usual error.

    "error in saving file. this is an unusual error. perhaps some computer maintenace is required"
    This notice keeps coming up whenever i try and save an audio file, which i have generated with "final vinyl".
    I have no idea what to do next. If anyone has any suggestions i would be most grateful.
    Adnan Sharaf

    That could make them up to 300 MB a piece, since that's the same format used by CDs. I would backup your data, and check to make sure the directory is in good shape as my FAQ explains:
    http://www.macmaps.com/backup.html
    http://www.macmaps.com/directoryfaq.html

  • CS6 & OSX 10.6.8 - saving files directly to the server does not work (most of the time)

    Hi there,
    we just switched from OSX 10.5.8 to 10.6.8
    OSX was installed on a new partition of the harddisk
    Then installed CS 5
    Then installed CS 6 via (adobe creative cloud)
    With CS6 we got also the problem with saving files to the server (program error)
    It happens mostly with photoshop, sometimes with Illustrator.
    I read a lot of posting regarding the same problem but didn´t found a real solution yet.
    I am also wondering that there seems to be no solution for this now, because most of the posting i read are 1 year old.
    Working locally is not really an acceptable workaround for us or anyone who needs to work with Creative Suite in a professional way.
    Our MACs…
    MAC Pro 4.1
    OSX 10.6.8
    Virtualized Server Solaris 10 with Helios UB+
    connected to server with afp://Server IP Adress
    Adobe Software
    CS 5 & CS 6
    Here´s some additional information from the osx system profiler:
    Hardware-Übersicht:
      Modellname:          Mac Pro
      Modell-Identifizierung:          MacPro4,1
      Prozessortyp:          Quad-Core Intel Xeon
      Prozessorgeschwindigkeit:          2,26 GHz
      Anzahl der Prozessoren:          2
      Gesamtzahl der Kerne:          8
      L2-Cache (pro Kern):          256 KB
      L3-Cache (pro Prozessor):          8 MB
      Speicher:          10 GB
      Geschwindigkeit für Prozessorverbindungstyp:          5.86 GT/s
      Boot-ROM-Version:          MP41.0081.B07
      SMC-Version (System):          1.39f5
      SMC-Version (Prozessormodul):          1.39f5
      Seriennummer (System):          CK9120Z98Q0
      Seriennummer (Prozessormodul):          J590807P51LUC    
      Hardware-UUID:          30149BDB-582E-583A-B776-59A6DEA2A32C
    Ethernet 1:
      Typ:          Ethernet
      Hardware:          Ethernet
      BSD-Gerätename:          en0
      IPv4-Adressen:          192.9.200.120
      IPv4:
      Adressen:          192.9.200.120
      Konfigurationsmethode:          Manuell
      Schnittstellen-Name:          en0
      Netzwerksignatur:          IPv4.Router=192.9.200.203;IPv4.RouterHardwareAddress=00:30:48:ba:70:30
      Router:          192.9.200.203
      Teilnetzmasken:          255.255.255.0
      DNS:
      Such-Domains:          floramedia.int
      Serveradressen:          192.9.200.7, 194.25.0.68
      Ethernet:
      MAC-Adresse:          00:23:df:df:96:e1
      Medienoptionen:          Voll-Duplex
      Medien-Untertyp:          1000baseT
      Proxies:
      Ausnahmeliste:          *.local, 169.254/16
      Passiver FTP-Modus:          Ja
      Reihenfolge der Dienste:          0
    Überblick über die Systemsoftware:
      Systemversion:          Mac OS X 10.6.8 (10K549)
      Kernel-Version:          Darwin 10.8.0
      Startvolume:          MAC_OSX_10_6_x_SNOW-LEOPARD
      Startmodus:          Normal
      Gerätename:          Freelancers Mac Pro 10.6.8
      Benutzername:          DENNIS (freelancer)
      Sicherer virtueller Speicher:          Nicht aktiviert
      64-Bit-Kernel and -Erweiterungen:          Nein
      Zeit seit dem Start:          8:09

    Hi franverdi-
    It sounds like you've run into issues from the upgrade. I've found a Support article that helps with issues of not being able to connect after an upgrade:
    [[Cannot connect after upgrading Firefox]]
    I hope that helps!

  • Saving files for metro apps in Windows 8/8.1 when printing

    Hi,
    I have a query regarding saving files for metro apps Windows 8/8.1.
    Metro apps saves the file automatically  to the Document folder when we print.
    But I would like to save the files into a recommened folder like C:\users\tmp\
    Please suggest me, is there a way to save the files to a particular folder for metro apps in Windows 8/8.1.
    Thanks in Advance
    Regards
    Toshik12

    As far as I know (and I may be wrong), there's no built-in file saving when printing documents.  How are you confirming that?
    You can save the file anywhere you want, as long as the user chooses the folder location using the FolderPicker.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Saving files on the same hard drive time machine is using

    I was wondering how I go about saving files other than backups on the hard drive I purchased. If you can help it would be greatly appreciated. Thank you.

    If you haven't started your Time Machine backups yet you can partition your new drive, using one partition for Time Machine and the other for file storage. If you assign partition #1 to Time Machine you can reclaim the space on partition #2 for Time Machine at a later time.
    You can follow the directions in this article. for formatting/partitioning a drive for Time Machine but you want to end up with two partitions rather than one. People with PPC Macs should substitute Apple Partition Map for GUID when following the directions.

  • Why are files in Firefox 33 cache directory different size than saved files on desktop

    In previous versions of Firefox I used the cache directory to extract videos, flash files and hidden images, that were not saved in folder and a HTML Document file on desktop. For Example the opening image of a YouTube Video can not be extracted and saved from Firefox but is stored in the cache directory.
    To find these files without going through them one at a time, I would copy the cache folder on a desktop folder and then use Double Killer to delete the same size files in both the cache and the saved files in the desktop file folder. The files that are left behind in the cache folder are those that did not save to the desktop file and folder. I can then double check to see if I can find the videos, flash or images from the remaining files.
    I have updated to Firefox 30.0.3. The problem now is that the files in the cache are different in KB size from the saved files on the desktop folder. The dimensions of a saved image are the same but the size of the file differ. Now I can not use Double Killer to delete files and have to go through the whole cache directory one by one to find files that were not saved.
    Why did the Firefox developers changed the cache directory? Do I need to revert to a previous version of Firefox or is there a way that I can change the cache directory of Firefox 33.0.3 and the size that it stores files.
    Would also like to know what add-on gives the best quality screenshot with flash.
    Thanks for this support. Apart from this cache problem I find Firefox easy to use and the best web browser.

    Current Firefox 32+ releases use a new cache service named Cache2 and this cache service works differently.
    Files in the cache2 folder are special files that also store the meta data apart from the actual file data that you see on the about:cache page if you click an item.

  • Problem Saving Files CS5

    After years of no problems I am suddenly having a problem saving files.  This started with CS4 a few months ago, and has continued with CS5.
    When I attempt to Save As... I get an error message:
         Could not save as "{location & filename}" because the file is already in use or was left open by another application.
    The only place the file could be considered "in use" or "left open" would be due to Bridge.
    I get this error message whether saving as jpg, psd or any other file type.  If I retry saving the file then it will usually save properly after several attempts.  But if I close Bridge then it will save the first time every time.  I get the same error whether saving as the original file name or with a new name.
    I have been using Bridge to preview and select the images I want to edit for a very long time.  But this problem didn't start showing up until a short time ago, so I wonder about a problem introduced with an update??    Those who use Bridge know that it remains running in the background while the image is processed through Camera RAW and PS.  There has never been a reason to close Bridge when working in PS and it is not very convenient to do so just to save a file.
    If anyone has a solution to this I would like to hear about it.
    Thanks,

    Hi Jimcarke,
    My problem is very similar. Just Upgraded to CS5 from CS4.
    Graphic files, no problem.  I can save 80Mb and 30 layered mixed graphic files, even after editing.
    No JPEG's in the stack though. Perhaps I'll have a look at that!
    With simple JPEG's at 1.9mb, after editing, then as soon as I enter 'Save As,' Bingo the great blank screen'
    Problem seems worse if I get as far as rotating the image, then everything disappears instantly.
    Customer services have suggested all the usual remedies and now I can't open a file or edit anything
    I'm back to the insufficient RAM issue.
    I've just 'given up' and back to CS4 again and will try to get some work done for the morning.
    All good fun and an interesting way to spend a very sunny Sunday afternoon. (GB)
    Regards
    John

  • Photoshop CS6 – Error When Saving Files

    When saving files using Photoshop CS6 I randomly receive an error message that states 'Could not save image_name.tif' because of a program error'. Sometimes a save-as works but not guaranteed. The file is being saved to a mounted server volume and sometimes the only way to get the file on the server is to save to the desktop and then copy the file back to the server. The error message does not appear on any other Adobe applications, just Photoshop.

    Moved from the Creative Cloud to the Photoshop forum. They will be able to help you here.

Maybe you are looking for

  • Use of Calendar in Days Supply Calculation in APO

    The Days Supply is R/3 is defined as - The range of coverage is then the number of workdays between todayu2019s date and the date of the requirement that causes the shortage minus one day The Days of Supply in APO defined as - The days' supply tells

  • Java.lang.NoClassDefFoundError: org/apache/axis/client/Service

    Hi, I am developing a WebService Client and for that i am using the Apache axis client. but when i am trying to instnatiate the org.apache.axis.client.Service class it says a NoClassDefinition Found error. Can anyone tell me the reason for this? Is t

  • Urgent: Object oriented ALV Refresh

    Hello: Pl let me know or share a code--- to update multiple lines selected from OO ALV GRID list in the SAP transparent table Also I am trying to update the data into transparent table. Using OO ALV . The lines are getting refreshed ... PERFORM refre

  • Screensaver not starting when iTunes is running. Works otherwise...

    Hi everyone, My screensaver will not start when iTunes is running (also Spotify). When the app is closed, the screensaver starts when it's supposed to (5 min. in my case, but have tried other time limits). I've tried changing mouse settings and even

  • Problem with zoom trigger

    Hi friends, here i have a requirement to Customize Material Transactions Form to Zoom to the form Order Header Form after entering the Sales Order Number against which the Material transaction is happening passing order header_id as parameter (Order