Skip to main content

Why underline text not working with Font.STYLE_PLAIN?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
bhakki
Offline
Joined: 2009-09-09

Hi,

I used this code for underlining text,

Font font = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_UNDERLINED | Font.STYLE_PLAIN, Font.SIZE_SMALL);

But its not showing the text with underline. But while using the following font means text showing with underline.

Font font = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_UNDERLINED | Font.STYLE_BOLD, Font.SIZE_SMALL);

What is the problem?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vprise
Offline
Joined: 2003-11-07

I have no idea why this isn't working for you, however our reccomended (and portable) way of underlining text is using the new underline property of style available in current SVN.