Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFileChooser

 
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
Marshal
Posts: 52664
121
  • 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
 
I child proofed my house but they still get in. Distract them with this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!