manual file associations not working :(

T

tiewknvc9

Hi!

I have developed an application and I have even successfully installed
it on a users machine!

WIth this success, one of the remaining mysteries to me is how to
properly associate the file with the application. I wanted to simply
add a file type association in Windows XP through the "Open WIth"
feature.. Using this feature doesnt work......

When I click on an associated file, the "working directory" is set as
the current directory of the set file. I dont want this, I want to
continue having the "working directory" as the folder where the
application is installed (also having all of the neccessary jar files
in that directory for the app to run).

I feel that this should be an easy thing to fix... Anybody have any
ideas on how to set the working directory to the applications
directory?????

Thanks
 
A

atilagunes

Hi

i think you take that file as a parameter in your main function.. isnt
there any function like getDirectory() or getPath() which find file's
path to set "open" and "save file chooser" 's path....? if there, you
can set fileChooser directory with setDirectory().

Regards
Atila Gunes
 
A

atilagunes

sorry, i realized that i didnt answer exactly what you ask.. i
understood your question wrongly..

so, you may use setDirectory to set the directory where your
application installed in if your application run with external file
parameter.. you can get directory path if you add it into register
before..
 
T

tiewknvc9

I appreciate your feedback.... but I dont understand how this will
work... as I am not using JFileChooser to choose the file to open :( ..
Although I may have described it poorly.

I'm trying to associate files in windows with my application, so that a
user can double click the file and have it open in my app.

But when I double click the files that are associated with the
application, how can I get the path to the .jar file that is actually
running? So far if I use new File(".") - it gives me the directory of
the file that I am opening...

Thanks!
 
O

Oliver Wong

tiewknvc9 said:
I have developed an application and I have even successfully installed
it on a users machine!

WIth this success, one of the remaining mysteries to me is how to
properly associate the file with the application. I wanted to simply
add a file type association in Windows XP through the "Open WIth"
feature.. Using this feature doesnt work......

When I click on an associated file, the "working directory" is set as
the current directory of the set file. I dont want this, I want to
continue having the "working directory" as the folder where the
application is installed (also having all of the neccessary jar files
in that directory for the app to run).

I feel that this should be an easy thing to fix... Anybody have any
ideas on how to set the working directory to the applications
directory?????

As a first step, I'd look into redesigning my application so that it
does not depend on the concept of a "working directory", as what this will
be is platform dependent.

- Oliver
 
T

tiewknvc9

Oliver said:
As a first step, I'd look into redesigning my application so that it
does not depend on the concept of a "working directory", as what this will
be is platform dependent.

- Oliver

How would I do that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top