How to call the HTML file in your java code

Total Post:44

Points:310
Java 
 1407  View(s)
Ratings:
Rate this:

Hi Guys

I am beginner in java programming language.Please help me how to call the HTML file in your java code.I would really appreciate your help.

Thanks


  1. Post:26

    Points:182
    Re: How to call the HTML file in your java code

    Yes you can call the HTML file in your java code.

    Sample code 


    Code of hi.html page

    <html>
      <head> 
        Test Application
      </head>
      <body>
         This is test application of Java 
      </body>
    </html>


    Java source code


    String url = "D:/hi.html";
    File htmlFile = new File(url);
    Desktop.getDesktop().browse(htmlFile.toURI());

      Modified On Apr-11-2018 10:24:43 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!