在需要向JButton发送消息的地方加上:(注意EventID的数值)事实上我这里是向button发送自定义事件,你修改一下让他变成click事件吧
ActionEvent ae =new ActionEvent(yourButton,yourEventID,"your description");
yourButton.dispatchEvent(ae);
ActionEvent ae =new ActionEvent(yourButton,yourEventID,"your description");
yourButton.dispatchEvent(ae);
设置应该没问题,我print了 e.toString and e.getID 等只好先放1放
CSDN 要死了??????