wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes need help with exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "need help with exception" Watch "need help with exception" New topic
Author

need help with exception

neha gautam
Ranch Hand

Joined: Mar 31, 2009
Posts: 32
hi all, i m gettin a null pointer exception in this, in line 28,43, 56, , but i m not able figure it out please help
code is






thanks to all
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1473
    
    6

C:\neha\files

\ is an escape character in java, so in this case you need

C:\\neha\\files

and same for getFilesInDir("C:\\neha"); in DirectoryTest.java

now even if you specify the correct path its possible that no files exist in the specified in the given directory , so you need to put check before continuing the process



Swastik
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Neha,
In future, please use code tags.
I have edited your original post to use code tags, and as you can see it makes the code easier to read an understand. It even displays the line numbers !


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
neha gautam
Ranch Hand

Joined: Mar 31, 2009
Posts: 32
got it!!!
thank a ton
neha gautam
Ranch Hand

Joined: Mar 31, 2009
Posts: 32
roger maneesh thanks
 
 
subject: need help with exception