I had been trying to do an object serialiation,deserialisation program.When i am giving the File Name directly in the FileInputStream ,my program runs quite finely and i was able to deserialise the object successsfully.But when i tried to use FileDialog,the serialisation program runs finely,but the deserialisation cannot be done. I am getting the following error:

java.io.FileNotFoundException: nullnull (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at package1.Deserialisation.main(Deserialisation.java:22)
Exception in thread "main" java.lang.NullPointerException
at package1.Deserialisation.main(Deserialisation.java:43) .

Can any one help me to resolve the same ande also explain in breif the reason for it so that mistakes are not repeated..