This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JEditorPane acting as web browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JEditorPane acting as web browser" Watch "JEditorPane acting as web browser" New topic

JEditorPane acting as web browser

janne jounivich
Ranch Hand

Joined: Jan 11, 2005
Posts: 45
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.


Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

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.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: JEditorPane acting as web browser
It's not a secret anymore!