my code!

jincheng2008 2009-05-06 05:32:50
public void actionPerformed(final ActionEvent e) {
List list = new ArrayList();
list = searchInfo(list);
updateTable(list, dftm);
}


private List searchInfo( List list) {
String sql = "select * from Tb_Spinfo where 1 = 1 ";
if (conditionName.getSelectedItem() != null &&
!conditionName.getSelectedItem().equals("---选择--")) {
sql = sql + " and category ='" + conditionName.getSelectedItem() +
"'";
}
String pyStr = ((JTextField) conditionContent.getEditor().
getEditorComponent()).getText().toString();
for (int i=0;i<=0;i++) {
if (!pyStr.equals("") || pyStr != null) {
sql = sql + " and spname like '" +pyStr + "%'";

} else if (conditionContent.getSelectedItem() != null &&
!conditionContent.getSelectedItem().equals("")) {
sql = sql + " and spname = '" +
conditionContent.getSelectedItem() +
"'";

} else {
sql =sql+"";
}

}
System.out.println("search="+sql);
list = Dao.findForList(sql); {
return list;
}
}
}


conditionContent.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
queryButton.doClick();
}
});
...全文
50 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
simplejoys 2009-05-06
  • 打赏
  • 举报
回复
看不懂!
luckyllp 2009-05-06
  • 打赏
  • 举报
回复
问问baidu!!
jincheng2008 2009-05-06
  • 打赏
  • 举报
回复
conditionName.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
initSpComboBox();
}
});

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧