java UIManager
UIManager.setLookAndFeel(“
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
”);//windows默认
UIManager.put("MenuBar.font", font);//给控件设置字体
static Object
put
(Object
key, Object
value)
public static void setLookAndFeel(String className, java.awt.Component c) {
try {
UIManager.setLookAndFeel(className);
SwingUtilities.updateComponentTreeUI(c);//注意这行
}
catch (Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(null,
"不好意思,setLookAndFeel时出错了:( Errormsg:" + ex,
"setLookAndFeel",
JOptionPane.INFORMATION_MESSAGE);
}
相关文档:
/**
*
* @param par
* 入力名
* @return 入力値
*/
public static String inputfromConsole(String par) {
System.out.println(par);
InputStreamReader ......
1.创建文件夹
File myFolderPath = new File(%%1);
try {
if (!myFolderPath.exists()) {
myFolderPath.mkdir();
}
}
catch (Exception e) {
System.out.println("新建目录操作出错");
e.printStackTrace();  ......
41、是否可以继承String类?
String类是final类故不可以继承。
42、swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上?
switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。long,st ......
package com.dongyang;
/*
* 读xls写xml
*/
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.XMLOutputter;
imp ......