Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

href in JOptionPane

 
Ken Clark
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've created a JOptionPane and am formatting the text using <html> tags. I'm able to add a link to a web site via the <a href="www.somwhere.com">Go Here</a>, and it shows up as a link in the JOptionPane. The problem is that nothing happens when I click on the link.
Do I need to create a MouseListener make this happen?

code snippet:

String message = "<html><center>";
message += "<p>Some text";
message += "<p><a href=\"http://www.yahoo.com\">Yahoo</a>";
message += "</center></html>";

JOptionPane.showMessageDialog(this, message, "Info", JOptionPane.INFORMATION_MESSAGE);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic