This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "problem in this code" Watch "problem in this code" New topic
Author

problem in this code

Rishabh Rathi
Greenhorn

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


field1.setText(chooser.getSelectedFile());


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
Bartender

Joined: May 03, 2008
Posts: 5045
    
  10

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: 10747
    
    9

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: http://aspose.com/file-tools
 
subject: problem in this code
 
It's not a secret anymore!