4

How can I add a clickable URL into a JOptionPane (in the middle of a text) ?

Philippe Carriere
  • 3,712
  • 4
  • 25
  • 46
  • 2
    This other answer has a pretty nice solution: http://stackoverflow.com/questions/8348063/clickable-links-in-joptionpane – bspkrs Dec 04 '13 at 16:17

1 Answers1

4

You can add any component to a JOPtionPane. So you can add a JEditorPane containing HTML with your clickable URL. That is the "message" Object which is passed as a parameter to the showXXX methods can be a Swing component.

camickr
  • 321,443
  • 19
  • 166
  • 288