0

I just want to underline a character in a string in my JLabel, how can I do that, I've been searching the web for a simple way of doing it in Java but I can't find anything. For example I have a text "Modify" in a JLabel and I just want to underline "M" in Modify how do I do that? Thanks in advance.

Underline the character in my string in a JLabel.

buencamino
  • 91
  • 1
  • 10

1 Answers1

1

You can use HTML in your JLabel text -

label.setText("<html><u>M</u>odify</html>");
Dave Drake
  • 323
  • 2
  • 12