我们添加对象的形式是介样滴。。。
School falseSchool = new School("请选择……");
jCB_searchschool.addItem(falseSchool);
jCB_userschoolMdf.addItem(falseSchool);
如果让它显示falseSchool 的某一属性,可以override一下School 类的toString()方法:
public String toString() {
return this.name_school;
}
这样jCombobox 显示出来的内容就是School 类的name_school属性了