• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Marshal
Posts: 28264
95
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.
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic