Cannot display Chinese char in JButton
Hi,
I run a java application in Windows connecting to two servers, one is on WAS6 Cluster and the other is on WAS6 stand alone. The text displayed in JButton is depend on locale(e.g. I use "FileChooser.openButtonText" as "Open").
When I set the locale to English, then connect to the two servers, the "Open" in JButton can be displayed. But when I set the locale to Chinese, then connect to WAS6 stand alone display the Chinese char in JButton successful, but display two suqare boxes in JButton connecting to WAS cluster.
I cannot belive the server side has anything to do with the text display, but I use the same Windows2003 machine and get two different reslut. I also test it on Windows2000(works well) and Window XP(the same situation as Windows2003).
Any help will be appreciate, thanks.
I'm not sure if there is any difference between the two servers' environment, but they deployed the same EAR files.
I don't have debug environment in Windows XP or 2003, so I can't do what you suggest now. The part of the code in client are like:
btnOpen.setText(UIConstants.openButtonText);
btnOpen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { doOpen(); }
});
public interface UIConstants
{
public static final intDEFAULT_ROW_HEIGHT= 22;
public static final StringokButtonText= UIManager.getString("OptionPane.okButtonText");
public static final StringcancelButtonText= UIManager.getString("OptionPane.cancelButtonText");
public static final StringyesButtonText= UIManager.getString("OptionPane.yesButtonText");
public static final StringnoButtonText= UIManager.getString("OptionPane.noButtonText");
public static final StringopenButtonText= UIManager.getString("FileChooser.openButtonText");
.....
}
Thanks for your suggestion, do you have any other ideas?
You didn't show the relevant part.Server, or server accessing part, directly or indirectly, should be fiddling with lolcale or encoding.
hiwaa at 2007-7-14 21:17:38 >
