-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.4.0
-
x86
-
windows_xp
Name: jl125535 Date: 10/16/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Japanese Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
On japanese windowsXP, I run a java application displaying
some chinese characters (NOT japanese characters), they
work well in a button, label, menu etc. but some character
become to ? on window title. for example \u4eec.
some character exsits both in chinese & japanese can be
displayed normally (\u6211 etc.), \u4eec is a character
only in chinese.
but I can displayed it on windows title by a program
developed by VC++, using SetWindowTitleW(UNICODE string)
not SetWindowTitleA(DBCS string).
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
MainApp.java
------------------------
import javax.swing.UIManager;
import java.awt.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class MainApp {
boolean packFrame = false;
//Construct the application
public MainApp() {
MainFrm frame = new MainFrm();
//Validate frames that have preset sizes
//Pack frames that have useful preferred size info, e.g. from their
// layout
if (packFrame) {
frame.pack();
}
else {
frame.validate();
}
//Center the window
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation((screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
}
//Main method
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName
());
}
catch(Exception e) {
e.printStackTrace();
}
new MainApp();
}
}
MainFrm.java
-----------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class MainFrm extends JFrame {
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
JLabel jLabel1 = new JLabel();
//Construct the frame
public MainFrm() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
// analyzeDb();
}
//Component initialization
private void jbInit() throws Exception {
//setIconImage(Toolkit.getDefaultToolkit().
// createImage(MainFrm.class.getResource("[Your Icon]")));
contentPane = (JPanel) this.getContentPane();
jLabel1.setText("jLabel1");
contentPane.setLayout(borderLayout1);
this.setSize(new Dimension(400, 300));
String ss = "\u6211\u4eec";
this.setTitle(ss);
jLabel1.setFont(new java.awt.Font("NSimSun", 0, 12));
jLabel1.setText(ss);
this.setFont(new Font("NSimSun", 0, 12));
contentPane.add(jLabel1, BorderLayout.CENTER);
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}
}
---------- END SOURCE ----------
(Review ID: 153609)
======================================================================