Results 1 to 9 of 9
  1. #1
    Join Date
    May 2008
    Location
    India,Kolkatta
    Posts
    50
    Rep Power
    0

    Default How to open html page?

    Hi Everybody,

    As you can tell by the title, I am very new to Java.

    I have a html page that I need to call from java.
    i use Runtime.getRuntime().exec("C:/Program Files/Internet Explorer/iexplore.exe"+" help.html") ; //help.html is the required html file which is stored in the same folder.

    But when i execute this code, browser is not able to open this page

    Please Suggest me a suitable code for opening of html page

    Thanks in advance..

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

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

    Default Reply

    Hi eranga,

    ya i got an exception there with error code=193.

    but now i successfully solve my problem using following code:

    Runtime.getRuntime().exec("cmd start help.html");

    thanks for your concern..

    hey Eranga, i have another problem regarding opening of exe.
    i just want to open any exe(like notepad,msword) within the Frame, like Internal Frame.is it possible???

    Please suggest..

    Thanks in advance..

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

    Default

    Any process is a Win32 application. As far as I know, we can't embedded such as process within a frame, I mean external component. Better to check in details, I don't have done it before.

    This is your requirement, but I want to say is that in Java there is lots of alternative for such things. TextArea for Notepad and so. If you use Notepad application is specific to Windows.

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

    Default REply

    Hi Eranga,

    ya for notepad we can use TextArea instead.
    but it wont serve my purpose..
    but it is possible in VB so i thought it should be possible in Java too.
    Lets see
    i am working on this one..

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

    Default

    hey Eranga,

    we can use JEditorPane for this???

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

    Default

    JEdiorPane is an extended component from JTextComponent. Basically we can use it to render plain, html or rtf text. If you say use of it as a TextAre(or as a notepad), yes you can.

  8. #8
    vkvk24081993 is offline Member
    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Default Re: Reply

    Runtime.getRuntime().exec("cmd start help.html");

    can open help.html page directly in browser? And can i do this by running o executing .class file from cmd?

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. How to close an open JFrame window from a jsp page?
    By kasisaiganesh in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 05-27-2008, 06:29 PM
  2. How to view applet from html page.
    By jwzumwalt in forum Java Applets
    Replies: 2
    Last Post: 11-24-2007, 04:21 AM
  3. HTML page
    By bbq in forum New To Java
    Replies: 1
    Last Post: 07-05-2007, 03:46 AM
  4. Create a Applet in the page HTML
    By Daniel in forum Java Applets
    Replies: 2
    Last Post: 07-04-2007, 07:52 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
  •