[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Unicode text in labels / Fields  XML
Forum Index -> Development
Author Message
heyl

Power User

Joined: 10/01/2008 09:41:55
Messages: 267
Location: Ettlingen
Offline

Hi everybody,

how can I load unicode text in the controls?

I can enter the text in the designer but it is not displayed in the controls.
See screen shot for example.
If I create the text dynamically in the bean (read it from the database for instance) and bind it to the fields it will display in the label but not in the field component.


 Filename UnicodeFields.JPG [Disk] Download
 Description
 Filesize 10 Kbytes
 Downloaded:  550 time(s)

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hmm, the general transfer of characters works fine, I can see the correct Chinese character in the debugger... With arabic it works without any problems (see screenshot).

Pls give us some hours...

Björn
[Thumb - screen.jpg]
 Filename screen.jpg [Disk] Download
 Description
 Filesize 35 Kbytes
 Downloaded:  450 time(s)


Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

...seems to be a problem "somewhere in Java / Swing": sometimes it works with Chinese characters, sometimes it doesn't...

I found a way to bypass: then explicitly calling the setFont(...) method ones per component, then everything seesm to work fine.

Setting of the font is now added a very central place. So with next correction release problem should be "bypassed".

Björn
[Thumb - screen2.jpg]
 Filename screen2.jpg [Disk] Download
 Description
 Filesize 32 Kbytes
 Downloaded:  420 time(s)


Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi,

no bypass necessary as described in the previous post...

The problem is solved. For all Java freaks...: when creating Fonts from another Font then make sure you use the deriveFont() method!

The following way to create a new Font....

Font newFont = new Font(existFont.getName(),existFont.getStyle(),existFont.getSize());

will NOT take over some significant font attributes, which seem to be quite important when dealing with Chinese language.

Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team