Article View: borland.public.jbuilder.java.swing
Article #9749finding the application path
From: Alan Shiers
Date: Sat, 15 Jan 2000 00:00
Date: Sat, 15 Jan 2000 00:00
24 lines
1493 bytes
1493 bytes
Hi:
I'm familiar with the File objects .path() and .getAbsolutePath()
methods, but these methods don't allow me to obtain the applications
path on the clients machine. In Visual Basic we have a method called
App.path. When I use this method call as part of a string concatination
App.path returns the path leading up to where the program sits on the
clients computer.
So, if myProgram is in C:\MSS\myProgram, App.path will return
"C:\MSS\".
This is how I would like to use App.path in java:
String st = App.path() + "text.txt";
Result: st would equal "C:\MSS\text.txt"
I need a method like this for Java! App.path is a very convenient
method, one that I use a great deal. I need to know, no matter where
the client installs my java program, it will be able to find it's own
application path within the directory structure it is in! Does anyone
have just such a method I can use, or is there already one in existance
in the API that I'm not aware of?
Regards,
Alan Shiers
Technical Details
Message-ID:
<388105F5.EB860769@istar.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c2ac60c7065ef2cf,start X-Google-Attributes: gid111d45,public From: Alan Shiers <jshiers@istar.ca> Subject: finding the application path Date: 2000/01/15 Message-ID: <388105F5.EB860769@istar.ca> X-Deja-AN: 573153688 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing