补充:无论是改1.4*的jre里面的文件还是在代码设置都可以。
解决方案 »
- 关于 文件读取
- 正则表达式的问题
- 请教一下关于Jtable的列宽问题。
- 粉嫩新人求牛人解惑啊
- 求一本 侯捷编的 java 经典
- 如何使用package?
- one question i do not know how 2do and what2do!
- 老问题了,可是...APPLET显示没有任何反应,我已经装了j2sdk-1_3_1_01,j2re-1_3_1_01a,各位大侠,帮帮忙吧!
- 怎样将JTree的handle图标改掉,以及出现如下横线的效果:
- 我在主窗口上,添加一个菜单栏和jpanel,删除jpanel,然后再添加一个jpanel。结果主窗口上的菜单栏和关闭窗口点击不起作用了。希望大神给指点一下。
- 在线急等,关于java的取位
- 怎么用jdom访问xml中带二进制内容的节点?
//全局字体设置-----------------------// Font font = new Font("宋体",Font.PLAIN,14); 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("OptionPane.messageFont",font);
UIManager.put("OptionPane.buttonFont",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);
UIManager.put("Table.font",font);
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test extends JFrame {
public Test() {
makeFace();
addListener();
showFace();
}
private void makeFace() {
Container contentPane = this.getContentPane();
contentPane.add(new JButton("按钮1"), BorderLayout.NORTH);
contentPane.add(new JLabel("标签1"), BorderLayout.CENTER);
contentPane.add(new JTextField("文本筐1"), BorderLayout.SOUTH);
}
private void addListener() {
this.addWindowListener(new WindowAdapter(){ //添加窗口关闭事件
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
private void showFace(){
setLocation(200,200);
pack();
show();
}
public static void main(String[] args) {
try {
String laf = UIManager.getSystemLookAndFeelClassName();
UIManager.setLookAndFeel(laf);
} catch (Exception exc) { }
//全局字体设置
Font font1 = new Font("宋体",Font.PLAIN,7);
Font font2 = new Font("宋体",Font.PLAIN,30);
Font font3 = new Font("宋体",Font.PLAIN,13);
UIManager.put("Button.font",font2);
UIManager.put("TextField.font",font1);
UIManager.put("Label.font",font3);
new Test();
}
}
本人不熟悉swing只是路过!
帮你UP!
男儿膝下有黄金!