• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hyperlinks in JEditorPane  RSS feed

 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a JEditorPane which shows an html document in a frame, but the links do not work. How can i open the url in browser when user clicks the link in my application?
Thanks for any help
Cheers
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to listen for the events generated when you click on the hyperlink. If you look in the javadocs for the JEditorPane you will see a good example there.
 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, but i want to open a new browser, not to show the new url in my editorpane.
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean like opening another IE or Firefox or is it a custom browser?
 
Kudret Serin
Ranch Hand
Posts: 167
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a listener (as mentioned before) and then call BrowserLauncher to find and open the native browser.

http://browserlauncher.sourceforge.net/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!