• 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

how to call browser from JEditorPane?

 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
I am making a program using swing. While working on JEditorPane I want to give a link which a user can click on. but would like on clicking the same the default browser should open and shows the page there but if I click there it opens the page into the JEditorPane itself.
Is there any possibility to open it in browser say IE or navigator?
Any suggestion?
regards,
Arun :roll:
 
arun mahajan
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think people have forgoten this posting..Pl suggest me some workaround for this..
regards,
arun
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Arun,
Well, I have a very nasty work-around for you and it goes something like this:

The java Runtime class has all the old Unix style "exec" methods which you can call to start a new child process. Unlike the old fork() call, you don't have any real control over the child. You can get the input, output and error streams of the new process but as far as I know there is no way to open a pipe between the two processes for communication. You can kill the child process with the destroy() method of the Process class.
This is of course extremely unportable and assumes that you know the location of IE or whatever browser is on the system never mind what platform you're running on.
Hope this helps
Michael Morris
SCJP
reply
    Bookmark Topic Watch Topic
  • New Topic