-
cannot display Symbol font face in JLabel
Hi, those who willing to help there. thank you in advance.
class FontLabel extends JLabel {
...
public void paint(Graphics g) {
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
String[] fontNames = env.getAvailableFontFamilyNames();
System.out.println("Available Fonts:");
for(int i=0; i<fontNames.length; i++)
System.out.println(" " + fontNames[i]);
Font fontSymbol = new Font( "Symbol", Font.PLAIN, pointSize);
Font fontWeb = new Font( "Webdings", Font.PLAIN, pointSize);
g.setFont( fontSymbol );
g.drawString( "\u2190",10,30);
}
I am able to display Arial Font face. but was stuck at display Symbol TrueType Font.
-
solve, may be
I think i found the answer.
i found it by reading Font API.
just to share you with this good article:
http://www.joconner.com/javai18n/art...xtDisplay.html
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks