• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in this code

 
Rishabh Rathi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's a textbox? Does its setText method accept a File? (not likely)
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the File API for methods which will give you the path of a given file
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic