中文问题。给你一个函数,调用一下就可以了,
public static String UnicodeToChinese(String s){
  try{
     if(s==null||s.equals("")) return "";
     String newstring=null;
     newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
     return newstring;
    }
  catch(UnsupportedEncodingException e)
  {
  return s;
  }
  }public static String ChineseToUnicode(String s){
  try{
  if(s==null||s.equals("")) return "";
  String newstring=null;
  newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
   return newstring;
  }
  catch(UnsupportedEncodingException e)
  {
  return s;
 }
  }

解决方案 »

  1.   

    方框表示字体不支持中文,问号才表示编码不对呢,所以楼上的做法应该是没什么用的。
    你用的是不是jdk1.4.0的Windows Look&Feel啊?这是一个Bug,1.4.1中已经修正了。
      

  2.   

    不是,我就是1.3,是先在一个component里创建一个bufferedImage,让后得到其
    graphics2d对象,在这个graphics2d上drawString个中文的字符串,让后在绘出整个的bufferedImage在这个component上,怎么办,高人,,救我...
      

  3.   

    我设置了一个物理字体,楷书,本机也有,可是试了encode转化,也没用,都还是不成,还是小方框,高人呀,再给出几招..期待结果.