Re: Is It Possible to Make Java Find a File on Your Computer?
On Aug 15, 11:07 am, "Jeff Higgins" <oohigg...@yahoo.com> wrote:
Lew wrote:
Jeff Higgins wrote:
Knute Johnson wrote:
They added some really nice features to version 6. The Desktop class
being one of my favorites. Runtime.exec() has a bunch of issues. I
haven't tested this on any version of Linux but on XP it works great.
Not having been aware of the Desktop class, Knutes' post interested
me enough to attempt to run his example. Several days ago I installed
the most recent version of Eclipse (Europa or 3.3). Now I am suprised
when I create a new file "path_to_.xls" in my project folder and an
instance of MS Excel is opened in a new Eclipse editor window!
I don't know if this capability was present in 3.2, but it sure is in
3.3.
Would this work to bring up Open Office if I don't have Excel on my
machine?
Um, Maybe?
I've occasionally thought of trying out OpenOffice, thanks for the impetus.
Right now I'm on a \home entertainment\ computer -
my regular pc had to go to the shop :( - back soon :)
This Platform = WinXP SP2, MS Word and Excel Version 7, Eclipse 3.3
Old processor, little memory, slow disk.
Anyway, Word & Excel seem to work fine. Writer & Calc seem to have
trouble displaying toolbars correctly. Probably just the old pc.
Maybe this functionality isn't new. I seem to recall seeing Open with... |
In-place Editor
in 3.2, may be wrong, not sure.
JH
Still working but just in case somebody needs it, this worked for the
second piece of Real's code I couldn't run :
String[] cmdArray = {"cmd", "/c", "start", "\"\"",
helpFile.getAbsolutePath()};
Runtime.getRuntime().exec(cmdArray);
i.e:
class StartExcel {
public static void main(String args[])
throws java.io.IOException
{
// Win XP
String[] cmdArray = {"cmd", "/c", "start", "\"\"",
helpFile.getAbsolutePath()};
Runtime.getRuntime().exec(cmdArray);
}
}
cheers!
JL