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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -