e.getSource()方法依赖于事件对象。

比如:JButton jbt = new JButton("button");中事件对象就是jbt

e.getActionCommand()方法依赖于按钮上的字符串

比如:JButton jbt = new JButton("button");中字符串button


简而言之:用e.getSource()得到的是jbt,而用e.getActionCommand()得到的是button。

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信