java - Underlined JLabel -
i trying make jlabel underlined. searched everywhere, got nothing. in properties, there no option underlining jlabel. can do?
jlabel label = new jlabel("<html><u>your text here</u></html>"); label.setcursor(cursor.getpredefinedcursor(cursor.hand_cursor));
or
jlabel label = new jlabel("underlined label"); font font = label.getfont(); map attributes = font.getattributes(); attributes.put(textattribute.underline, textattribute.underline_on); label.setfont(font.derivefont(attributes));
Comments
Post a Comment