你用的是jb么?
将jb的字体改为宋体什么的,label上就可以显示中文了

解决方案 »

  1.   

    不是吧. . . 
    label有自己默认的Font的,如果那个Font不支持中文. 你改JB的字体有什么用?
      

  2.   

    有一个这样的方法:
    1.首先
        private static ResourceBundle resources;    static {
            try {
                resources = ResourceBundle.getBundle("resources.Notepad", 
                                                     Locale.getDefault());
            } catch (MissingResourceException mre) {
                System.err.println("resources/Notepad.properties not found");
                System.exit(1);
            }
        }
    2.如下用,
    String vpFlag = resources.getString("ViewportBackingStore");
    3,然后,
    add(new Label(vpFlag));
    说明:../resources/Notepad.properties文件
    文件有这样一行
    ViewportBackingStore="中国队加油"
      

  3.   

    new JLabel("Hello!Swing World",new ImageIcon("fox.gif"),JLabel.CENTER)当作为应用程序运行时正常,当作为小应用程序运行时提示错误,文件fox.gif不能读取.其中fox.gif放到同一虚拟目录下。请问怎么办?
      

  4.   

    Hello.java/*
    *<Applet code=Hello width=300 height=150>
    *</Applet>
    */
    import javax.swing.*;
    import java.awt.event.*;public class Hello extends JApplet {
    public void init() {
    getContentPane().add(new JLabel("Hello!Swing World",new ImageIcon("fox.gif"),JLabel.CENTER));
    }
    public static void main(String[] args) {
    JFrame f=new JFrame("Hello");
    Hello helloApplet=new Hello();
    helloApplet.init();
    f.getContentPane().add(helloApplet);
    f.addWindowListener(new WindowEventHandler());
    f.setSize(300,150);
    f.show();
        }
    }class WindowEventHandler extends WindowAdapter {
    public void windowClosing(WindowEvent e){
    System.exit(0);
    }
    } test.htm<html>
    <head><title>Java Applet Example</title></head>
    <body>
    <center>
    <applet code="Hello.class"  width=300 height=200></applet>
    </center>
    </body>
    </html>
      

  5.   

    把原来Label上的英文String 替换为 中文String.
     如String English="english";
     换为String English="英文";
     注意在KAVA环境中要用copy才能将“英文”二字拷到里面去
     而不能直接输入。