How do you write a class to return a file?

So I've read http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html But I still do not know how to pass a file to a calling method of another class. How does the FileChooser class retrun the file. Please help.
[245 byte] By [mransomea] at [2007-11-27 9:46:10]
# 1
Read the API. Even comes with an example. http://java.sun.com/javase/6/docs/api/javax/swing/JFileChooser.html
CeciNEstPasUnProgrammeura at 2007-7-12 23:56:06 > top of Java-index,Java Essentials,New To Java...
# 2
Planning on re-posting this every day until someone does the work for you?
georgemca at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...
# 3
Please help somebody do I simply "return fileObject"?Any help will be appreciated.
mransomea at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...
# 4
I am not lazy. I am an excellent VB programmer and I am honestly struggling with Java. I read that it does not help me to understand what I want to do and all I want to do is return a file to a calling object.Message was edited by: mransome
mransomea at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...
# 5

You mean something like this?

import java.io.File;

public class FileTest {

public File getFile(String path) {

//Example path = "C:\\path\\to\\file.txt"

return new File(path);

}

}

_helloWorld_a at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...
# 6
Obviously that method is overkill but it demonstrates the very tricky :-) task of return a File Object.
_helloWorld_a at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...
# 7
Thank you george for your motivation. I have solved the problem.
mransomea at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...
# 8
> I am an excellent VB programmerRelevance?
ita6cgra at 2007-7-12 23:56:07 > top of Java-index,Java Essentials,New To Java...