Results 1 to 12 of 12

Thread: HTMl file

  1. #1
    serfster is offline Member
    Join Date
    Jun 2008
    Posts
    8
    Rep Power
    0

    Default HTMl file

    Is it possible to display an html file in a java application and if so, how? Don't ask why I need to do this, I just do!

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    10

    Default

    Where woudl people be able see the html? To write a web page from java I just put the raw html as string literals.

  3. #3
    serfster is offline Member
    Join Date
    Jun 2008
    Posts
    8
    Rep Power
    0

    Default

    I am trying to get something like a box that contains a web page to appear within a GUI application. Is this possible to code?

  4. #4
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default

    You can try this using JEditorPane

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

    Default

    That's the best option we have, if we want to interact with the web page, like URLs and so on. You can do it on a label too. Not not perfect at all.

  6. #6
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default Reply

    hey Eranga,

    i can open an html page using JEditorPane.
    But what if i want to open an simple html page in a browser itself.

    will Runtime.getRuntime().exec("C:/Program Files/Internet Explorer/iexplore.exe"+" help.html") ; serve the purpose????

    /*help.html is the required html file which is stored in the same folder*/

    Thanks in advance..

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

  8. #8
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default

    Hi Eranga,

    No i haven't i only know that that exec is used to run application.Any way i solved my problem.

    i use the following code:
    Runtime.getRuntime().exec(cmd start help.html);
    and its working fine..

    Thanks alot for your concern..

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

  10. #10
    Timo is offline Member
    Join Date
    Feb 2009
    Posts
    1
    Rep Power
    0

    Smile Hello everyone

    I am new to this forum. Have developed in Java a few years ago. At the moment, I am not using Java seriously but am planning to. So, I see myself as a beginer but hope to be of help as I get back in the game.

    Kind regards
    Timo

  11. #11
    MK12's Avatar
    MK12 is offline Senior Member
    Join Date
    Jan 2009
    Posts
    185
    Rep Power
    8

    Default

    Timo, please only post things relevant to the thread's subject. To introduce yourself, there is an Introductions form in the home page. Hijacking someones thread is not a good idea, it is pretty easy to make your own thread (and in correct forum).
    Last edited by MK12; 02-13-2009 at 01:29 AM.
    Tell me if you want a cool Java logo avatar like mine and I'll make you one.

  12. #12
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    Quote Originally Posted by serfster View Post
    Is it possible to display an html file in a java application and if so, how? Don't ask why I need to do this, I just do!
    Actually it is GUI Swing topic )
    yes it is more than possible. To get the effect you can use JEditorPane. lib javax.swing.*;
    it is quite powerful tool to display html file in java application) try it

Similar Threads

  1. How to print a HTML file in browser look using JAVA
    By ammameiya in forum Advanced Java
    Replies: 5
    Last Post: 06-25-2010, 02:36 AM
  2. Include Java file in HTML Page
    By kathyc in forum New To Java
    Replies: 2
    Last Post: 03-07-2008, 04:51 AM
  3. Replies: 7
    Last Post: 08-12-2007, 03:47 PM
  4. how to call a JAR FILE from HTML
    By leonard in forum Java Applets
    Replies: 1
    Last Post: 08-05-2007, 06:06 AM
  5. how to upload a file along with html form data
    By pranith in forum Java Servlet
    Replies: 3
    Last Post: 07-30-2007, 02:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •