• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

printing extended characters in swing

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I posted this earlier in Java General forum :-(
But let me be more specific this time...
Is there any way I can on a JLabel print a "tm" (trademark) symbol from extended character set/extended ascii ?
Thanks in advance.
 
Ansh Bhai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
of course this could apply to any other character as well...I just wanna know how would one approach this problem. Do I have to play with fonts? UIManager? Unicode?
 
Ansh Bhai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
calling java experts...last call!
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are covered by the default fonts, at least on Windows, since the TM character, Unicode 0x2122, is Latin-1 Windows code page.

(Edit for code layout.)
[ June 18, 2002: Message edited by: John Dale ]
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few additional remarks on how to approach the problem.
1) Find the Unicode value of the character you are after.
a) The general way to do this is to use thecode chart at www.unicode.org.
b) If you are running a Unicode version of Windows (e.g., NT, 2000, but I don't know about 9x,ME), you can use the Windows character map utility. What characters you can see depends on what font you select (and what Windows language support you have installed), but the fonts witih unicode in the name tend to show more symbols. If using Windows NT, betware that the code in the "Windows" sections are not necessarily Unicode (usually CP1252 instead); you want codes are start with, as I recall, "U+" (which you will write as \u in Java.
2) For a character to display, you must use the right code and use a configured in your Java runtime and installed in your operating system that contains a glyph for that character. The easy way is to just try it an see what happens. The Windows character mapper will allow you to see what is installed on your system. The jre/lib/font.properties file will let you see what is installed in your Java environment. The Java internationalization documentation will help you understand the font.properties.
(3) Beware of the US English Only version of the Java runtime from Sun. It does not include the i18n.jar file, and has limited character support. I think all the developer environments I've seen, the "all language" runtime environments from Sun, and all runtime environments from IBM have i18n.jar. (But I've never looked at the 1.0.x, pre 1.1.6, and Win16 stuff.)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic