两个问题,1。Boolean中的getBoolean(String name)我的参数不管是什么,返回的都是false,2,jcheckbox里我setSelect(true),以后setSelct(
1,看Boolean的Source code, getBoolean的意思是去取系统变量中的这个name的变量是否为"true"
public static boolean getBoolean(String name) {
boolean result = false;
try {
result = toBoolean(System.getProperty(name));
} catch (IllegalArgumentException e) {
} catch (NullPointerException e) {
}
return result;
}
private static boolean toBoolean(String name) {
return ((name != null) && name.equalsIgnoreCase("true"));
}2,应该是不会这样的,你把你的代码贴出来看看
public static boolean getBoolean(String name) {
boolean result = false;
try {
result = toBoolean(System.getProperty(name));
} catch (IllegalArgumentException e) {
} catch (NullPointerException e) {
}
return result;
}
private static boolean toBoolean(String name) {
return ((name != null) && name.equalsIgnoreCase("true"));
}2,应该是不会这样的,你把你的代码贴出来看看
public static boolean getBoolean(String name)Returns true if and only if the system property named by the argument exists and is equal to the string "true". (Beginning with version 1.0.2 of the JavaTM platform, the test of this string is case insensitive.) A system property is accessible through getProperty, a method defined by the System class.
If there is no property with the specified name, or if the specified name is empty or null, then false is returned.
Parameters:
name - the system property name.
Returns:
the boolean value of the system property.