File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes HELP!! Trying to read a file In the dir. I have changed to. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "HELP!! Trying to read a file In the dir. I have changed to." Watch "HELP!! Trying to read a file In the dir. I have changed to." New topic
Author

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

david mohr
Greenhorn

Joined: Jan 13, 2002
Posts: 12
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

Joined: Nov 26, 2001
Posts: 50
Try changing:

To:

The getName() method on file does not contain the parent directory name.


Brent Worden
david mohr
Greenhorn

Joined: Jan 13, 2002
Posts: 12
Thanks Brent. I really appreciate your help. I have spent several hours trying to figure it out.
David Mohr
 
 
subject: HELP!! Trying to read a file In the dir. I have changed to.
 
Threads others viewed
Resize problem with JMenuBar
JFrame and JMenu
Help!! I cannot figure out how to have my menu items show up on top of my textarea.
toolbar in internalframe
JDesktopPane creates inner frame menuItem actionPerformed does not.
IntelliJ Java IDE