• Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP!! Trying to read a file In the dir. I have changed to.

 
david mohr
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently able to read a file from the default dir. When I use the the File chooser I can read any file with the dir. it prompts me to. But, when I change directories I cannot read the files in a different dir. ??? I have created a class with a method that reads the file passed in as the arg. and returns its contents in a String. The class name is Filereaderclass and the method is called getinfo(String filename). This is the code. The stuff commented out is another problem I am having. But, I think that problem should be posted in the Swing section. I am fairly new at this so If you see a bunch of other problems please let me know. Thank you for all your help.
David mohr

[ April 02, 2002: Message edited by: Peter Tran ]
[ April 02, 2002: Message edited by: Peter Tran ]
 
Brent Worden
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing:

To:

The getName() method on file does not contain the parent directory name.
 
david mohr
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Brent. I really appreciate your help. I have spent several hours trying to figure it out.
David Mohr
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!