I am trying to add a hyperlink to JPanel. I would like to make the text blue (and underlined) and the link should be selected (in order to copy part of it). So I tried using JLabel: yes, it allows you to write something [terrible] like this:
someLabel.setText("<html><font color=\"#0000ff\"><u>http://example.com</u></font></html>");
But, unfortunately, JLabel does not allow you to select any text. I also tried using JTextField, but in contrast, it does not allow the use of HTML / CSS in fields.
So, is there any way to create a hyperlink (with the correct indication) with the basic Swing components that will allow me to select [and copy] a part of it, or should I try to use some third-party components? Thank.
source
share