CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: FileDialog

  1. #1
    Join Date
    Aug 2002
    Posts
    17

    FileDialog

    Hi,
    I'm using FileDialog from AWT. How do I know when the open button is hit? Is there a listener that I should use?
    Thanks,
    Akee

  2. #2
    Join Date
    May 2002
    Location
    Atlanta,GA
    Posts
    262

    Re: FileDialog

    Originally posted by akee
    Hi,
    I'm using FileDialog from AWT. How do I know when the open button is hit? Is there a listener that I should use?
    Thanks,
    Akee
    The Open() or Show() ( Can't remember which ) will return once the open button has been hit.
    Jared

  3. #3
    Join Date
    Aug 2002
    Posts
    17

    Re: FileDialog

    Hi,
    What I was trying to do was to take the filepath and put it in a text box on a different form than the FileDialog window when the user hits load in the FileDialog window. I don't know how to get the text or set up event listening for the load button. I'm kinda new at doing GUI's in Java.
    Thanks,
    Akee

  4. #4
    Join Date
    Jan 2001
    Location
    Germany
    Posts
    222
    Greetings.

    Take a look at the API Specification and you'll find an answer.

    First, call the show() method of the dialog. That blocks your app until the user has chosen a file and dismissed the dialog. Then, to get the chosen file, call one of those getDirectory() or getFile() methods. You can tell if the user has Cancelled the dialog by their returned values. If he has cancelled it, those methods return null, otherwise they return a String object.

    Hope that helped,
    Captain Nuss
    Teamwork Software - Stuff That Does Something

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured