This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JEditorPane acting as web browser

 
janne jounivich
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have the following kind of scenario I am trying to achieve. I have a frame in which I have currently a JEditorPane component. This component has gotta a Hyperlink listener listening to hyperlink actions on various URL.

It works ok but this functionality is not enough for me. What I am achieving is I wanna my jEditorPane to listen to submit button clicks as well and thereby doing necessary actions. Is this possible with jEditorPane or should I use another component to achieve my goal?

Or maybe I should approach the problem differently? Is is possible to open another program (in my case browser) with the help of eg.
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + page);
inside Swing application?

I would appreciate any kind of help you can provide.

BR,Janne
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's the Bare Bones Browser Launcher, and BrowserLauncher2 as well as components developed by the Java Desktop folks - there's a cross platform browser, and a Windows-only one that wraps IE - there's also the JDIC Desktop class - which provides the "browse(URL)" method that launches the default browser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic