tags:

views:

29

answers:

2

Is there some way to display text as hyperlink in JTextField so that when user presses it opens the link in a browser

+1  A: 

You can't do that. Instead you want to use a JEditorPane:

http://download.oracle.com/javase/tutorial/uiswing/components/editorpane.html

Accatyyc
A: 

Technically, you can override some methods of JTextField, like onClick(..), so you can check what you clicked at and if it starts with "www" or "http", open default web browser with that link as a parameter. But try to look at other text components, probably there will be some that can open link "by default".

gasan