Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2004

Tip: Looking for answers? Try searching our database.

Charset?

Thread view: 
Viktor Lofgren - 30 Jul 2004 14:09 GMT
Is there a way to set the charset of the swing widgets (just JTextField
and JTextPane would do as well)? Currently all extended characters are
rendered as square "boxes".

Thanks in advance :-)
Thomas Weidenfeller - 30 Jul 2004 14:35 GMT
> Is there a way to set the charset of the swing widgets (just JTextField
> and JTextPane would do as well)? Currently all extended characters are
> rendered as square "boxes".

Java (including Swing) only uses one charset: Unicode. If you don't get
your characters displayed, then usually one of the following has happened:

    - You didn't use the appropriate charset conversion from an external
charset to Java's internal unicode. Your Java Strings and chars are
trashed due to the missing/wrong conversion. You will not only have
display problems, but other character and string related methods can
fail in mysterious ways (e.g. sorting).

    - You are using a font which doesn't have the necessary glyphs to
display the particular characters. Change to a font with the necessary
glyphs.

More unlikely reasons are

    - A trashed Java installation where e.g. the font.properties file is
trashed

    - A trashed OS, e.g. trashed OS font data

BTW: "extended characters" is a meaningless term.

/Thomas
Roedy Green - 30 Jul 2004 14:59 GMT
>Is there a way to set the charset of the swing widgets (just JTextField
>and JTextPane would do as well)? Currently all extended characters are
>rendered as square "boxes".

Not the charset, but the font. Different fonts support different
chars.

to check out, see http://mindprod.com/fontshower.html

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Viktor Lofgren - 30 Jul 2004 15:23 GMT
> Not the charset, but the font. Different fonts support different
> chars.
>
> to check out, see http://mindprod.com/fontshower.html

Strange, that page says that the font i'm using should support the
characters i'm trying to render.
Carl Smotricz - 30 Jul 2004 20:00 GMT
How are you putting those characters onto your components? In code?

Change your code and use the Unicode escape sequences instead. I'd
expect your characters to show up nicely then.

>>Not the charset, but the font. Different fonts support different
>>chars.
[quoted text clipped - 3 lines]
> Strange, that page says that the font i'm using should support the
> characters i'm trying to render.
Roedy Green - 30 Jul 2004 20:19 GMT
>Strange, that page says that the font i'm using should support the
>characters i'm trying to render.

Perhaps they are only available to the browser/applet, not generally.

It hard to diagnose remotely.  I presume you have proved to youruself
you can see those characters in your own app when you fill the
TextField/JTextField programmatically rather than by keystrokes3.

Did you ever run Keyplay?

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Viktor Lofgren - 31 Jul 2004 03:10 GMT
>>Strange, that page says that the font i'm using should support the
>>characters i'm trying to render.
[quoted text clipped - 4 lines]
> you can see those characters in your own app when you fill the
> TextField/JTextField programmatically rather than by keystrokes3.

Yeah, that's a bit weird. I can see them if i cnp them from some text,
but not if i enter them with keystrokes in JTextField / other text entry
widget.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.