Greek/latin scientific JLabel in Java Swing application

Posted by MartinStettner on Stack Overflow See other posts from Stack Overflow or by MartinStettner
Published on 2010-05-10T08:02:58Z Indexed on 2010/05/10 9:34 UTC
Read the original article Hit count: 340

For a scientific application I want to design an input form which lets the user enter certain parameters. Some of them are designated using greek letters, some of them have latin letters. The parameter names should be displayed using ordinary JLabel controls.

On Windows, the Tahoma font (which is used for Labels by default) contains both latin and greek letters, so I simply set the Text property of the label to a greek (unicode) string and everything works fine.

I'm wondering if this works also without modifications on Linux and OSX systems resp. for which Java/OS versions this would work.

Also I'm curious if there's an easy way to show subscripts in labels ("\eta_0" in TeX), but this is not that important for my application ...

© Stack Overflow or respective owner

Related posts about java

Related posts about swing