aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Problem with Java swing directory chooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with Java swing directory chooser " Watch "Problem with Java swing directory chooser " New topic
Author

Problem with Java swing directory chooser

Rahul Raj cochin
Greenhorn

Joined: Mar 29, 2012
Posts: 9
I have used swing directory chooser to select input directory for my application to process.
But if I select a particular directory, for example..
c:/Desktop/user/documents/myfolder

filechooser.getcurrentDirectory() returns only "c:/Desktop/user/documents/".
Why? Can anyone say why this is happening?

Rahul Raj cochin
Greenhorn

Joined: Mar 29, 2012
Posts: 9
I want to get the current directory, and not the parent directory..
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Set the mode to DIRECTORIES_ONLY and retrieve the selected file.


luck, db
There are no new questions, but there may be new answers.
Rahul Raj cochin
Greenhorn

Joined: Mar 29, 2012
Posts: 9
The problem is resolved.
I changed "filechooser.getcurrentDirectory()" to "filechooser.getSelectedFile()"
No further changes made..
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Rahul, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/awt-swing/59482-problem-java-swing-directory-chooser.html

edit And http://forums.digitalpoint.com/showthread.php?t=2469894&s=71b196d4865b761443d63c4690d9fa1e#post17641360
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Java swing directory chooser
 
Similar Threads
Can not get the absolute path of the running applet class
It compiled but couldn't run,help me make it run
JFileChooser problem
JFileChooser Last Path
Download pdf file in struts2