每个控件都有setFont方法的,你用这个方法试试

解决方案 »

  1.   

    运行出来的样子真难看,菜单,toolbar上的汉字,怎么都那么难看呀?!!!
      

  2.   

    up有分,我再帮你up,况且我也想知道,呵呵
      

  3.   

    我试过setfont()了,况且也只有几种英文font和中文好象没有多大联系,所以出来的界面一样好丑呀,字笔画都有点歪歪扭扭的!
      

  4.   

    Font f = new Font("宋体",Font.PLAIN,15);
              UIManager.put("Button.font",font);
      UIManager.put("ToggleButton.font",font);
      UIManager.put("RadioButton.font",font);
      UIManager.put("CheckBox.font",font);
      UIManager.put("ColorChooser.font",font);
      UIManager.put("ToggleButton.font",font);
      UIManager.put("ComboBox.font",font);
      UIManager.put("ComboBoxItem.font",font);
      UIManager.put("InternalFrame.titleFont",font);
      UIManager.put("Label.font",font);
      UIManager.put("List.font",font);
      UIManager.put("MenuBar.font",font);
      UIManager.put("Menu.font",font);
      UIManager.put("MenuItem.font",font);
      UIManager.put("RadioButtonMenuItem.font",font);
      UIManager.put("CheckBoxMenuItem.font",font);
      UIManager.put("PopupMenu.font",font);
      UIManager.put("OptionPane.font",font);
      UIManager.put("Panel.font",font);
      UIManager.put("ProgressBar.font",font);
      UIManager.put("ScrollPane.font",font);
      UIManager.put("Viewport",font);
      UIManager.put("TabbedPane.font",font);
      UIManager.put("TableHeader.font",font);
      UIManager.put("TextField.font",font);
      UIManager.put("PasswordFiled.font",font);
      UIManager.put("TextArea.font",font);
      UIManager.put("TextPane.font",font);
      UIManager.put("EditorPane.font",font);
      UIManager.put("TitledBorder.font",font);
      UIManager.put("ToolBar.font",font);
      UIManager.put("ToolTip.font",font);
      UIManager.put("Tree.font",font);这样可以把整个JAVA程序的字体 改成你所需要,你可以试试
      

  5.   

    不知你有没有设过程序的LookAndFeel,设置为Motif或者Windows的LookAndFeel时,界面的文字会好看多了。下面是程序片段,给了三个LookAndFeel:
    .
    .
    .
    class MenuFrame extends JFrame
    {
    public MenuFrame()
    {
    setTitle("MenuTest"); try
    {
    //以下任选其一,你也可以在程序运行时进行切换。前两个的字体都较好看。
    //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    SwingUtilities.updateComponentTreeUI(MenuFrame.this);
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    .
    .
    .
      

  6.   

    楼上改的是整个JAVA程序的界面风格,但有一个,就是如果不把字体改成具体字体的话,在WINDOWS风格下,中文还是乱码!!!!!!,只有用具体的SetFont将所有控件的字体改成一个具体字体,比如setfont("宋体",0,14)(设置成14号的宋体)才可以解决windows风格下的乱码问题!