baczek00
31 Aug 2012, 11:32 AM
Hi all,
I have this code
CheckColumnConfig checked = new CheckColumnConfig(ColumnDatabaseName,
ColumnName, ColumnSize) {
@Override
protected String getCheckState(ModelData model, String property,
int rowIndex, int colIndex) {
String s = (String) model.get(property).toString();
String r = "";
if (s == "1") {
r = "-on";
} else {
r = "-disabled";
}
MessageBox.info(s + " (Length: "+Integer.toString(s.length())+")", r, null);
return r;
}
};
return checked;
}
Why is my statement "if" shows that the variable "r" is equal to "-disabled" when it is not true as seen in the attached picture?38392
I have this code
CheckColumnConfig checked = new CheckColumnConfig(ColumnDatabaseName,
ColumnName, ColumnSize) {
@Override
protected String getCheckState(ModelData model, String property,
int rowIndex, int colIndex) {
String s = (String) model.get(property).toString();
String r = "";
if (s == "1") {
r = "-on";
} else {
r = "-disabled";
}
MessageBox.info(s + " (Length: "+Integer.toString(s.length())+")", r, null);
return r;
}
};
return checked;
}
Why is my statement "if" shows that the variable "r" is equal to "-disabled" when it is not true as seen in the attached picture?38392