• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

load web page from standalone app?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a standalone application, I want to start up a browser session (if one isn't available already) and load a web page (my website's FAQ). How do I do this?
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Runtime.getRuntime().exec()
Or if you prefer a pure java solution, you can display HTML in
Swing Components.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, this is a good example of how to display HTML using Swing.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
one way to do it is to use Runtime and give an exec call to
"iexplore YourURL"

Hope this helps.
Vinod.
 
Marc Santiago
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm kind of looking for a non-platform-specific implementation, so starting an instance of IE wouldn't always work. What I was really looking for was a way to say to the OS, 'I want to display this web page - go fire up whatever you use for a browser and load this URL'.
I'm curious about the Swing implementation. Does this embed a web browser into your standalone app, or does it somehow invoke the OS's 'default' web browser? If it uses its own embedded browser, would it understand Javascript? I couldn't tell from just reading the page.
Thanks everyone for all your help!
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marc S.:
I'm curious about the Swing implementation. Does this embed a web browser into your standalone app, or does it somehow invoke the OS's 'default' web browser? If it uses its own embedded browser, would it understand Javascript?


JeditorPane and JTextPane are Java GUI controls which can be used to display HTML (and other formatted text). I do not believe it understands Javascript. There is no cross-platform way to invoke the OS's 'default' web browser.
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A lot of work was put in to Browser Opener - com.Ostermiller.util Java Utilities. This is as platform independant as you can get. There is no java class ( besides the Runtime class, which is OS specific ) which can do this.
Jamie
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On another note:
Marc S.:
Welcome to the Ranch! We hope you’ll enjoy pounding back pints of java help on a regular basis. However, we do have one tiny rule around these parts. Please change your display name to one that satisfies our tiny rule, the naming policy( The skinny of the rule: just use a real firstname, followed by a space and a real lastname ). That's all! Thanks again and we hope to see you ordering up pints of java help and pitchers of java answers on a regular basis!
Jamie
 
Marc Santiago
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Ostermiller Browser looks like exactly what I'm looking for. Thanks!
Oh, and I fixed my name. Sorry about that - I'm just a little paranoid about my private info.
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BrowserLauncher. I have used it for years:
http://browserlauncher.sourceforge.net/
brian
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm moving this to the Other APIs forum...
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic