Results 1 to 2 of 2
  1. #1
    dpedroia15 is offline Member
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    Default Openening a File in Any Directory

    Hey, so I have a program that when a button is clicked on the GUI, it will open an executable program. The problem is, if I'm going to share it, people may have this executable in a different directory from me.

    So for example, I have this in "C:\\Personal\Games" and someone else may have it in "Public\Games".

    How would I make it so that my program will open the same file on any computer in any directory?

    Thanks

    EDIT:**Typo in the title >.<

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    > How would I make it so that my program will open the same file on any computer in any directory?

    Change the button's behaviour so that it uses the correct file location.

    Consider:

    (1) Specifying the file's location as an argument to the program
    (2) Demanding the user install the file at some particular location
    (3) Having the location configurable by the user when they run the program. (Saving the preferences makes for a nice problem.)

Similar Threads

  1. Is there a way to read a file directory
    By willemjav in forum Java Applets
    Replies: 3
    Last Post: 09-05-2011, 02:01 AM
  2. How to import file from same directory?
    By Splat in forum New To Java
    Replies: 5
    Last Post: 10-14-2009, 05:11 AM
  3. Replies: 2
    Last Post: 05-11-2009, 11:07 AM
  4. [SOLVED] File chooser selecting file from directory...?
    By prabhurangan in forum AWT / Swing
    Replies: 12
    Last Post: 06-18-2008, 05:08 AM
  5. How to Move a File to Another Directory
    By Ada in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 02:17 PM

Posting Permissions

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