This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes underlining label caption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "underlining label caption" Watch "underlining label caption" New topic
Author

underlining label caption

H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
hey guys

looking at the API, i can see that class Font does not have attribute UNDERLINE... is there a way to have Jlabel caption underlined?

thank u
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
html is one way

JLabel label = new JLabel("<html><u>Hello World</u></html>");
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
thnx

but what if the string to be underlined is a variable?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
exactly the same way as any string

"string"+variable+"string"
H Melua
Ranch Hand

Joined: Jan 04, 2005
Posts: 172
Bless u, done it
Hannah
[ December 31, 2005: Message edited by: H Melua ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: underlining label caption