Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #2448
| From | "Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: [follow] issue with j |
| Message-ID | <stevewjackson-CEBC81.13352914092007@individual.net> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <fcehhs$tmh$1@registered.motzarella.org> |
| Date | 2011-04-27 15:39 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui
In article <fcehhs$tmh$1@registered.motzarella.org>,
Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:
> On 2007-09-14, Steve W. Jackson <stevewjackson@knology.net> wrote:
> > In article <fcedg0$fn3$1@registered.motzarella.org>,
> > Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:
> >
> >> I have deployed my Java GUI to our local intranet and it does start up
> >> as expected by kicking off Java Web Start. However, when I press a
> >> button on the GUI, I expect to see a webpage, but nothing happens.
> >> The same GUI runs fine, with the expected results when I run it from the
> >> command line using java -jar.
> >>
> >> What should I start looking at to determine why my buttons are not
> >> opening up web pages.
> >
> > Um...the code behind their action listeners?
>
> private void JButtonActionPerformed(java.awt.event.ActionEvent evt) {
>
> // TODO add your handling code here:
> invokeBrowser("cmd /C start http://www.google.ca/");
> }
>
>
> private void invokeBrowser(String commandString) {
> try {
> Runtime.getRuntime().exec(commandString);
> } catch (IOException ex) {
> ex.printStackTrace();
> }
> }
I've learned never to use the single string version of the exec() method
since it will parse those strings and may not always produce what you
expect.
Then there's also the fact that that code only works on Windows, and not
necessarily reliably on older ones.
But that looks as if it should work -- except for a possibility which
occurs. I'm thinking that JWS may have security or access restrictions
similar to those of an applet. If so, it may not be allowed to execute
that command unless there's some signing done.
= Steve =
--
Steve W. Jackson
Montgomery, Alabama
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[follow] issue with jws "Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "Thomas Fritsch" <thomas.fritsch@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
Re: [follow] issue with j "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
csiph-web