• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Open HTML file in desktop app

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

I wanna open and display an HTML file in my app. I don't wanna open a browser, I wanna show it within my app.

I have searched and found this way:



Works fine for websites. But the thing is that I'm offline and I wanna open a local HTML file, not one in a site.
I've tried changing the path to: /home/me/path/myfile.html, but it gives me a MalformedURLException - no protocol.

How can I do to display local HTML files?

thanks
 
Sheriff
Posts: 28365
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The protocol you are missing is the "file" protocol. You need something like this:

file:///home/me/path/myfile.html

Here "file://" is the protocol and "/home/me/path/myfile.html" is the file name. Although it's possible that you may run into an implementation of the protocol that requires more or fewer slashes than what I put there.
 
reply
    Bookmark Topic Watch Topic
  • New Topic