• 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

Do we have Greek letters in Java??

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Do we have Greek letters in Java??I am creating a GUI using Java and I want to display a few equations in my GUI.Is there any way to do this???
thx,
Pomchi
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You just need to use a font that supports those characters.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could try using Unicode characters for this.
Try these URLs for some good info on using unicode in Java: http://www.sun.com/developers/gadc/faq/java/files/unicode.html#1.1 http://www.pccl.demon.co.uk/java/unicode.html
 
Pomchi Bedi
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matt & Karen,
Can you give me a simple example of how to do this??I have never done any such thing before.Infact in Java I never got a chance to play with fonts either.
I highly appreciate your prompt response.
Thanks
Pomchi
 
Karen Parker
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to find the unicode values for the specific characters you need (see www.unicode.org), but I will give you an example.
The unicode value for the Greek capital theta is 0398. To display this character in Java:

(where x and y are the coordinated at which you wish to draw the string)
This would display the string "This is theta: " followed by a theta symbol.
The "\u" basically tells Java to take the value of the next four characters in the string and convert them into a unicode character.
 
Pomchi Bedi
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Karen!!
I got it!
-Pomchi
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic