File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes JFileChooser Last Path Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "JFileChooser Last Path" Watch "JFileChooser Last Path" New topic
Author

JFileChooser Last Path

Binh Lam
Greenhorn

Joined: Jul 18, 2002
Posts: 4
Hi all,
Does anyone know how to obtain the path of the last accessed path for the JFileChooser. For example, if the default path for
JFileChooser chooser = new JFileChooser() is "My Documents" and the user open the chooser dialog and save the file named saveFile in C:\\ directory. The next time the chooser dialog open, the path should default to C:\\.

Thanks for you help in advance.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2559

One way is to store this path in a String variable like strLastPath, and store this variable in a properties file or sth. Then you can read this variable and open JFileChooser in the approprtiate folder/directory using JFileChooser(String )'s constructor which takes path.
HTH,
- Manish
 
 
subject: JFileChooser Last Path
 
Threads others viewed
Setting default name in JFileChooser
Use of JFileChooser
JFileChooser loses focus when clicked away and back
Setting a path in JFileChooser
JFileChooser (Open File Dialog)
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture