Author |
Message |
14/01/2008 15:43:46
|
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 |
Download
|
Description |
|
Filesize |
10 Kbytes
|
Downloaded: |
551 time(s) |
|
|
|
14/01/2008 16:48:56
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5520
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
|
Filename |
screen.jpg |
Download
|
Description |
|
Filesize |
35 Kbytes
|
Downloaded: |
451 time(s) |
|
Björn Müller, CaptainCasa GmbH |
|
|
14/01/2008 20:10:07
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5520
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
|
Filename |
screen2.jpg |
Download
|
Description |
|
Filesize |
32 Kbytes
|
Downloaded: |
421 time(s) |
|
Björn Müller, CaptainCasa GmbH |
|
|
15/01/2008 05:31:40
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5520
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 |
|
|
|