This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying symbols & spl char in applet

 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic