Get current directory from JFileChooser
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Get current directory from JFileChooser

  1. #1
    Join Date
    Apr 2010
    Posts
    4

    Get current directory from JFileChooser

    Hello, Im trying to get the current directory out of my JFileChooser. I would like to turn this current directory to a string, something like String userdir = fc.getCurrentDirectory(); This obviously doesnt work. Is there anyway to do this?

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    Re: Get current directory from JFileChooser

    Read the API docs.

    getCurrentDirectory() returns a File object and the File class has many methods for extracting the file information as a string.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center