Results 1 to 2 of 2
- 12-29-2011, 11:09 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 1
- Rep Power
- 0
how can i get directory path without select any file ?
how can i get directory path without select any files just select directory by user ?
i tried to use "jfilechooser " but user must choose someone file to get its directory path but i want to make the user select just " directory " to save his file in it ???
- 12-29-2011, 11:52 AM #2
Re: how can i get directory path without select any file ?
You could set the path of the class containing the main() method with
File startingDir = new File(ClassWithMain.class.getProtectionDomain().get CodeSource().getLocation().getPath());
Instead of ClassWithMain you can use an other class in your project root or a reachable class in the classpath.
Similar Threads
-
I need to set new directory path in tomcat
By Mayank Joshi in forum Java ServletReplies: 2Last Post: 05-05-2010, 12:16 PM -
Read file from directory, update contents of the each file
By svpriyan in forum New To JavaReplies: 2Last Post: 05-11-2009, 10:07 AM -
Select File
By Doctor Cactus in forum New To JavaReplies: 2Last Post: 11-06-2008, 05:38 AM -
how to use JFileChooser to select file -> string
By gezzel in forum AWT / SwingReplies: 15Last Post: 10-23-2008, 05:34 AM -
[SOLVED] File chooser selecting file from directory...?
By prabhurangan in forum AWT / SwingReplies: 12Last Post: 06-18-2008, 04:08 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks