File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes problem in this code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem in this code" Watch "problem in this code" New topic

problem in this code

Rishabh Rathi

Joined: Mar 07, 2011
Posts: 13
I want to browse for folder and want the browsed path in the textbox....


here chooser.getSelectedFile() is giving me the path of browser and know i want that path to be in field1( i.e text box) .how i can perform the above task so as to get the desired output
Darryl Burke

Joined: May 03, 2008
Posts: 5115

What's a textbox? Does its setText method accept a File? (not likely)

luck, db
There are no new questions, but there may be new answers.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10836

Check out the File API for methods which will give you the path of a given file

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link:
subject: problem in this code
It's not a secret anymore!