//以导入按钮为例
//添加导入按钮
KDWorkButton btnInput = new KDWorkButton();
btnInput.setName("btnInput");
// btnInput.setText("导入员工"); //设置按钮名称
btnInput.setToolTipText("导入员工"); //设置鼠标选中时显示标识
btnInput.setIcon(EASResource.getIcon("imgTbtn_input")); //设置图标
add(btnInput, new Constraints(876, 94, 25, 19, 9)); //设置按钮x轴,y轴,宽,高,锚定值
//添加单击事件监听
btnInput.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
//事件内可以进行代码逻辑控制
UIContext context = new UIContext(FluctuationBillEditUICTEx.this);
try {
IUIFactory uiFactory = UIFactory.createUIFactory(UIFactoryName.MODEL);
IUIWindow uiWindow = uiFactory.create(FluctuationBillDataImportUI.class.getName(), context, null,OprtState.VIEW);
uiWindow.show();
} catch (Exception e1) {
e1.printStackTrace();
}
}
});