博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
设置分录行按钮监听事件
阅读量:6574 次
发布时间:2019-06-24

本文共 1887 字,大约阅读时间需要 6 分钟。

hot3.png

public static  void addNewLineButtonButtonListener(DetailPanel detailPanel,final KDWorkButton btnAddLine,final KDWorkButton btnInsertLine,final KDWorkButton btnRemoveLine,final CoreBillEditUI editUI) throws Exception{		KDWorkButton addLine = detailPanel.getAddNewLineButton();		KDWorkButton insertLine = detailPanel.getInsertLineButton();		KDWorkButton removeLines = detailPanel.getRemoveLinesButton();				MouseListener mousadd1[] = addLine.getMouseListeners();		MouseListener mousadd2[] = insertLine.getMouseListeners();		MouseListener mousadd3[] = removeLines.getMouseListeners();				for (int i = 0; i < mousadd1.length; i++) {			addLine.removeMouseListener(mousadd1[i]);		}		for (int i = 0; i < mousadd2.length; i++) {			insertLine.removeMouseListener(mousadd2[i]);		}		for (int i = 0; i < mousadd3.length; i++) {			removeLines.removeMouseListener(mousadd3[i]);		}				addLine.addMouseListener(new MouseAdapter() {			public void mousePressed(MouseEvent mouseevent) {				//调用editUI的新增行Action(actionAddLine)				ActionEvent e = new ActionEvent(btnAddLine, 0, "Click btnAddLine");				try {					editUI.actionAddLine_actionPerformed(e);				} catch (Exception e1) {					e1.printStackTrace();				}			}			});				insertLine.addMouseListener(new MouseAdapter() {			public void mousePressed(MouseEvent mouseevent) {								ActionEvent e = new ActionEvent(btnInsertLine, 0, "Click btnInsertLine");				try {					editUI.actionInsertLine_actionPerformed(e);				} catch (Exception e1) {					e1.printStackTrace();				}			}			});				removeLines.addMouseListener(new MouseAdapter() {			public void mousePressed(MouseEvent mouseevent) {								ActionEvent e = new ActionEvent(btnRemoveLine, 0, "Click btnRemoveLine");				try {					editUI.actionRemoveLine_actionPerformed(e);				} catch (Exception e1) {					e1.printStackTrace();				}			}			});	}

在editUI调用即可!

转载于:https://my.oschina.net/hipanda/blog/1583307

你可能感兴趣的文章
利用Linq对集合元素合并、去重复处理
查看>>
AS3.0 Bitmap类实现图片3D旋转效果
查看>>
BZOJ1876:[SDOI2009]SuperGCD——C++高精度良心题解
查看>>
2018-2019 20165226 Exp5 MSF基础应用
查看>>
yum安装的JDK的没有配置环境变量但是在/usr/bin下面都做了软链接
查看>>
设备坐标和逻辑坐标
查看>>
Django 自带 user 字段扩展及头像上传
查看>>
Android Studio快捷键
查看>>
Maven学习篇一:依赖了解
查看>>
SOA:面向服务编程——竹子整理
查看>>
Django 框架之前
查看>>
【java】安全加密MessageDigest的功能及用法【hash一致性算法】
查看>>
ZOJ 2107 Quoit Design(分治法解最近对模板题)
查看>>
Android学习系列(9)--App列表之分组ListView
查看>>
基于数据库复制的技术架构讨论
查看>>
Android学习网站(1)
查看>>
jenkins Email-ext plugin插件中Pre-send Script设置说明
查看>>
error错误信息状态码含义
查看>>
学习这门课的一些问题
查看>>
TD Rigging Demo Reel 性感美女绑定展示
查看>>