Results 1 to 3 of 3
- 02-27-2009, 09:57 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 2
- Rep Power
- 0
Handling hyperlinks and standard text in a table cell
Hi,
I have a Jtable with one column that displays text that sometimes include hyperlinks, for example:
What i would like would for the hyperlink to be represnted as a hyperlink and be clickable to open in a browser, but the standard text to remain unchanged.Java Code:This cell contains a link to www .google. com
So far i have only found examples that make the entire cell a hyperlink, which isn't quite what i want.
If anyone could shed some light on this, it would be much appreciated. If it makes any difference, the app only has to run on a windows machine.
Thanks in advance for any help!
gb
- 02-27-2009, 10:01 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
- 02-28-2009, 07:30 AM #3
Senior Member
- Join Date
- Jan 2009
- Posts
- 671
- Rep Power
- 5
mtyoung alluded to a possible solution. If you make the cell contents a JEditorPane, you can set the kit type to "text/html", which will present hyperlinks properly.
Caveat: JEditorPane does not actually handle hyperlink clicks. You have to add handlers for that yourself. Building a fully operational browser around JEditorPane requires a *LOT* of code.
Similar Threads
-
standard deviation and mean for an array
By peterdfl in forum New To JavaReplies: 3Last Post: 05-29-2008, 04:09 AM -
[SOLVED] hyperlinks in JTextPane
By olbion in forum New To JavaReplies: 4Last Post: 05-05-2008, 03:28 AM -
hyperlinks from menu items?
By asterope118 in forum New To JavaReplies: 1Last Post: 07-16-2007, 01:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks