📄 catehandler.java
字号:
package zichan;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class CateHandler extends MyHandler implements ActionListener{
CateModel em;
public CateView addEv;
public CateView uptEv;
public CateHandler() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void actionPerformed (ActionEvent e){
if (e.getActionCommand() == "add") {
em = new CateModel(addEv.p1.jtfCateId.getText(),
addEv.p1.jtfCateName.getText(),
addEv.p1.jtfSubCateId.getText(),
addEv.p1.jtfSubCateName.getText());
em.insert();
}
if (e.getActionCommand() == "upt") {
em.SetAll(uptEv.p1.jtfCateName.getText(),uptEv.p1.jtfSubCateName.getText());
em.update();
}
if (e.getActionCommand() == "sel") {
if (Share.verify(uptEv.p1.jtfSubCateId)) {
em = new CateModel(uptEv.p1.jtfCateId.getText(),null,uptEv.p1.jtfSubCateId.getText(),null);
em.select();
uptEv.p1.jtfCateId.setText(em.getCateId());
uptEv.p1.jtfCateName.setText(em.getCateName());
uptEv.p1.jtfSubCateName.setText(em.getSubCateName());
}
}
if (e.getActionCommand() == "del") {
em.delete();
uptEv.p1.jtfCateId.setText(em.getCateId());
uptEv.p1.jtfCateName.setText(em.getCateName());
uptEv.p1.jtfSubCateId.setText(em.getSubCateId());
uptEv.p1.jtfSubCateName.setText(em.getSubCateName());
}
}
private void jbInit() throws Exception {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -