• Post Reply Bookmark Topic Watch Topic
  • New Topic

JFileChooser  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm sure this question must have been asked before and there are lots of demos concerning the use of file choosers but could someone give me some advise, or link, as to how:

I can use a JFileChooser in netbeans such that when I press the 'Open' button I can get the absolute path of the file sent to a variable.

Cheers
 
Campbell Ritchie
Sheriff
Posts: 55371
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't use the JFileChooser in NetBeans; you use it in Java.

I would have thought the easiest things to do is to get a File object from the getSelectedFile() method of JFileChooser, then get the path from a method like this one,

Have you read the Java Tutorial page about File Choosers?
CR
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advice. I tried looking at the Sun website that detailed JFileChooser last night but it seemed like the website went down or something....

Thanks again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!