It's not a secret anymore!*
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
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: 4642
    
    5

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: 10491
    
    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!]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: problem in this code