> According to the API, getParentDirectory(File dir) returns the parent
> directory of dir. Does this mean that if I look for a filename "dir", it
> will return the name of the directory in which the file is?
why don't you try it and tell us the result?

Signature
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
>According to the API, getParentDirectory(File dir) returns the parent
>directory of dir. Does this mean that if I look for a filename "dir", it
>will return the name of the directory in which the file is?
Have you tried it?
Can you think of any alternative plausible behaviour?

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Huub - 27 Oct 2005 19:23 GMT
> Have you tried it?
>
> Can you think of any alternative plausible behaviour?
I'm trying to, but I have a conversion question. I'm reading String from
keyboard, which I convert to File:
String tvps = tvpatroon.getText();
FileSystemView fsv;
File file = fsv.createFileObject(tvps);
Then I have to convert it back to String in order to display it with
JOptionPane. Is there a simpler way to do this?
Roedy Green - 28 Oct 2005 08:12 GMT
>Then I have to convert it back to String in order to display it with
>JOptionPane. Is there a simpler way to do this?
File has all sorts of toString style methods. For a summary of them
see http://mindprod.com/jgloss/file.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Oliver Wong - 28 Oct 2005 18:09 GMT
>> Have you tried it?
>>
[quoted text clipped - 9 lines]
> Then I have to convert it back to String in order to display it with
> JOptionPane. Is there a simpler way to do this?
I don't think it gets much easier than a single method call:
fsv.getName();
- Oliver