内有代码,编译不通过,为什么? 你的MouseListen没有指定那个存在参数的构造函数你必须增加一个。你可以初始化多个的MouseListen的实例,或者传递那个Button的对象到这个Listen中,那样就可以知道那个Button了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 e.getActionCommand()获得按钮名字if(e.getSource() instanceof JButton){ }来判断是否是按纽 public void MouseListen(KeyEventTest p){ parent=p; } here no void will be okObject source = e.getSource()if( source == button_name ){ do what you want} 没有啊,我不是已经声明了一个带参数的构造函数吗?public void MouseListen(KeyEventTest p){ parent=p; } 晕,看没看我写的东西啊没有voidvoid也是一种返回值,构造函数不能有任何的返回值。 UDP队列问题 关于struts2 + spring + hibernate 整合的问题 学习java难度在何处? 高手请进! 鼠标右键点击树的节点,为什么焦点不移到该节点上? 一个很菜的线程问题 调用存储过程的问题!急!! 困惑——请问JAVA都说很好,但JAVA这么多技术,到底那些是值钱的哦? 请问怎么作出jar文件? [求教]关于静态方法不能访问不使用static修饰的普通成员 的 问题 static这个关键字该如何理解呢? 我写的应用程序MAIN FRAME都很长,怎样才能让结构合理,大家提提意见,都有分。
if(e.getSource() instanceof JButton){
}来判断是否是按纽
parent=p;
} here no void will be okObject source = e.getSource()
if( source == button_name ){
do what you want
}
public void MouseListen(KeyEventTest p){
parent=p;
}