Results 1 to 2 of 2

Thread: Launching an html file from a WizardPanel

Hybrid View

  1. #1
    TomaAtRevX Guest

    Launching an html file from a WizardPanel

    I need to be able to launch a readme type file contained in the setup jar file from one of the wizard panels, only after a user has checked the option in a checkbox.

    Has anyone done this? If so how, any tips would be appreciated.

    Thanks,
    Tom

  2. #2
    vindoan Guest
    There are two ways to launch a html browser:

    a) Quick and Dirty:
    The most versatile way to do this is by using the Windows95 start command as follows:

    Runtime.getRuntime().exec("start iexplore [webaddress or file]");

    or

    Runtime.getRuntime().exec("start netscape [file or address]");

    By using the start command your Java program loads faster and guarantees a new browser window.

    This can be further refined by taking advantage of the fact that html files are bound to the default browser, so you don't even have to specify the browser!

    Runtime.getRuntime().exec("start http://www.microsoft.com");

    and

    Runtime.getRuntime().exec("start c:\\java\\index.html");

    are both valid.

    Note: You will need to implement your own "start" script on other platforms

    B) Pure java: see the long example here: http://www.croftsoft.com/library/tutorials/browser/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •