> ...
>
[quoted text clipped - 43 lines]
>
> Andrew T.
> If you happen to come across with the solution to how to tell the host
> system to open a file and you can lend it to me I will be very
> thankful.
You may be able to create a Windows-only solution using the Windows command:
rundll32 url.dll,FileProtocolHandler <some filename or URL>
which, I believe, opens the indicated file with the user's default program for
opening that file-type, or opens the user's default browser on the given URL.
Other URLs schemes (mailto: etc) should also work if Windows understands the
scheme well enough to know what application to launch.
It seems to work for me with both absolute and relative filenames (UNC
filenames too, which surprised me).
I don't really know how it works, so I can't comment on how widely available it
is (on Windows), or on how reliable it is, or on what hidden gotcha's there may
be. If the idea seems useful at all then I suggest some research with Google
and at MSDN.
-- chris
..
> I tried what you suggested, first the hyperlink listener, the problem
> is that you have to add code in the hyperlink for it to work,
Oh, if I'd known you did not want to do any
coding, I'd have recommended elance.
>..I
> mean... the hyperlink listener kinda rises an event, so I still need
> to add code for the hyperlink to open the PDF and I don't know how to
> tell the host system to open the PDF.
Try this link..
<http://www.physci.org/jws/basicserv.jnlp>
..it should open a small app. on-screen.
Then paste this URL into the JTextField, ..
<http://java.sun.com/j2se/1.4/pdf/versioning.pdf>
..and hit 'enter'.
> Well, the showDocument() function works but only with web pages
Did you confirm that locally? Where is your code?
What is your system description? How did it fail?
..or are you just making this up as you go along?
>..and
> even if it worked with files the function needs the entire URL and I
> canot foretell the drive of the CD drive the user will have or even if
> he'll be running the program from the CD.
Can you get a File handle to the PDF of interest?
I understood that you could. If that is the case,
converting it to URL is simple, if not, you need
to solve that first.
>..Have been peeking in other
> applications similar to the want I want to design but looks like no
> buddy have ever made something like this.
It is quite common and aesy.
> If you happen to come across with the solution to how to tell the host
> system to open a file and you can lend it to me I will be very
> thankful.
Most of the solution has been laid out for you
in my first post. If you had taken the time to
try some of the things to which I linked.
>...You can contact me via e-mail if you would prefer.
You can pay me consultancy rates, if you prefer,
or we can continue this here, for free. But here,
I expect you to read my replies carefully, and try
the examples that I link to.
As an aside, you will get better help from me if you
turn your "I can't do that" moaning into "How do I do
that?".
Andrew T.