• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Open a HTML file

 
Bob Mazz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me some code to simply open a HTML file in a web browser please. Thankyou
 
Saj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using what u need 2 achive this? Be specific when u post the queries.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just double click the html file it will automatically open in browser.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use one of the java.lang.Runtime.exec() methods to launch the browser, if you know the path to the executable. Because Java is cross-platform, you can't just assume that it's IEXPLORE.EXE . You might ask the user to find the browser program in a file-selection box, then use Runtime.exec() to launch it.
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This definitely needs to be in an FAQ somewhere - not that anyone would read it though
Use BrowserLauncher - http://browserlauncher.sourceforge.net/
Works great.
brian
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saj,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Pipa:
This definitely needs to be in an FAQ somewhere

I agree. This topic has come up a few times.
Don't forget that you have the ability to add it to the FAQ. It's a wiki after all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic