小问题,快来捡分了--如何是运行出来的界面上的文字,漂亮一些?--up有分哟!!!! 每个控件都有setFont方法的,你用这个方法试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 运行出来的样子真难看,菜单,toolbar上的汉字,怎么都那么难看呀?!!! up有分,我再帮你up,况且我也想知道,呵呵 我试过setfont()了,况且也只有几种英文font和中文好象没有多大联系,所以出来的界面一样好丑呀,字笔画都有点歪歪扭扭的! 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程序的字体 改成你所需要,你可以试试 不知你有没有设过程序的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(); }... 楼上改的是整个JAVA程序的界面风格,但有一个,就是如果不把字体改成具体字体的话,在WINDOWS风格下,中文还是乱码!!!!!!,只有用具体的SetFont将所有控件的字体改成一个具体字体,比如setfont("宋体",0,14)(设置成14号的宋体)才可以解决windows风格下的乱码问题! Java 上传视频 并截图 关于使用Java多线程实现倒计时牌的问题多算出30天百思不得其解 java如何读写pdf文件,并转化成二进制文件。 在SWT中使用TabFolder,并添加了几个TabItem,怎么在程序中使某个TabItem被选中 又是==和equals(100分) 一个inteface被多个类同时使用,内存是否会成倍增加? 关于IF条件式 请教如何只去掉一个字符串右边的空格? 一条基础题目,还是不太懂底层的东西 问一个关于方法重载的简单的问题 用Java编写的一个小Applet为什么不能在NetCaptor浏览器中显示? jbuilder注册问题!!!!!!
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程序的字体 改成你所需要,你可以试试
.
.
.
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();
}
.
.
.