It's not a secret anymore!*
The moose likes Applets and the fly likes displaying symbols & spl char in applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "displaying symbols & spl char in applet" Watch "displaying symbols & spl char in applet" New topic
Author

displaying symbols & spl char in applet

Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
i am trying to display special characters and symbols from fonts in character map. i am not getting the character displayed , a empty rectangle is displayed . help me to resolve it
Vlado Zajac
Ranch Hand

Joined: Aug 03, 2004
Posts: 245
How are you displaying the characters? And what OS the applet runs on?

I succesfully display (char)9650 and (char)9660 in a Swing applet as part of JTable column name.
Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
i tried this sample program to get that


import javax.swing.*;
import java.awt.*;
class fonttest
{
public static void main(String[] args)
{
Font wingF = new Font("Symbol", Font.PLAIN, 36);
JFrame jf=new JFrame("testfont");
JLabel jl=new JLabel("\u006e");

jl.setFont(wingF);
jf.getContentPane().add(jl);
jf.show();
}
}

to display a arrow symbol
Swathi Prakash
Ranch Hand

Joined: Jan 18, 2005
Posts: 49
hey i got special characters in applets

wingF = new Font("Wingdings 3", Font.PLAIN, 9);

String s ="\uf071";
sym.setColor(Color.red);
sym.drawString(s,k,messageY);
 
jQuery in Action, 2nd edition
 
subject: displaying symbols & spl char in applet
 
Similar Threads
character code
unicode math characters
Get the characters from String.
Arabic unicode characters in HTML
Japanese Font & Java