here is the source code for my filezipper class to zip files. but it runs till s.o.p(" line48")and doesn't continue.I get my frame along with the filechoser window .Even the file zipfile.zip is created but remains a null file of 0 bytes.any one to help me.
Edit with ubb code tags for clarity [This message has been edited by Carl Trusiak (edited February 06, 2001).]
You never initialize the String inputfilenames and when you try to add to it at inputfilenames[j]=inputfiles[j].getPath(); it throws a null pointer exception change the code String inputfilenames=null; File inputfiles=chooser.getSelectedFiles(); To: File inputfiles=chooser.getSelectedFiles(); String inputfilenames= new String[inputfiles.length]; And it'll work fine. Do your self a big favor! NEVER have an empty catch block. If you would have had something as simple as
it would have made debugging easier! ========================================== Please Read and Following ourNaming Policy It can benefit you read Book Giveaway
[This message has been edited by Carl Trusiak (edited February 06, 2001).]
thanks a lot Carl. well ,that was really a silly mistake by me or may be i couldn't figure it out that time.I am trying to explore the various capabilities of java .I may trouble u a little more sometime later. Thanking u
Joined: Feb 04, 2001
i did the necessary changes you suggested .I got a zipexception saying "there must be atleast one entry in the zipoutputstream" also that before this the FileChooser.getSelectedFiles() method returns a null array of type File.Is there some problem with my JFileChooser instance and code therein.I get this Exception on clicking the open button of JFileChooser Component.Please help me .
Joined: Jun 13, 2000
We have a Naming Policy If you wish to continue with us, please register with a proper name that meets the requirements. People who do not will have their accounts blocked. I am looking forward to your posts